org.easetech.easytest.runner
Class BaseSuite

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runner.Runner>
          extended by org.junit.runners.Suite
              extended by org.easetech.easytest.runner.BaseSuite
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
Direct Known Subclasses:
DataDrivenTestRunner

public class BaseSuite
extends org.junit.runners.Suite

Base Suite class for EasyTest based Runners. This class abstracts a lot of boiler plate logic so as to give EasyTest based Runners convenient and single place for reference.

Author:
Anuj Kumar

Nested Class Summary
 
Nested classes/interfaces inherited from class org.junit.runners.Suite
org.junit.runners.Suite.SuiteClasses
 
Field Summary
protected  List<org.junit.runners.model.FrameworkMethod> methodsWithData
          List of FrameworkMethod that does have any external test data associated with them.
protected  List<org.junit.runners.model.FrameworkMethod> methodsWithNoData
          List of FrameworkMethod that does not have any external test data associated with them.
protected  List<org.junit.runner.Runner> runners
          A List of DataDrivenTestRunner.EasyTestRunners.
protected static Map<String,List<Map<String,Object>>> writableData
          An instance of Map that contains the data to be written to the File
 
Constructor Summary
protected BaseSuite(Class<?> klass)
          Construct a new BaseSuite.
 
Method Summary
protected  List<org.junit.runner.Runner> getChildren()
          Get the children Runners
 void registerConverter(Converters converter)
          Method responsible for registering the converters with the EasyTest framework
protected  org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
          Returns a Statement: We override this method as it was being called twice for the same class.
protected  org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
          Returns a Statement: We override this method as it was being called twice for the same class.
 
Methods inherited from class org.junit.runners.Suite
describeChild, emptySuite, runChild
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writableData

protected static Map<String,List<Map<String,Object>>> writableData
An instance of Map that contains the data to be written to the File


runners

protected final List<org.junit.runner.Runner> runners
A List of DataDrivenTestRunner.EasyTestRunners.


methodsWithNoData

protected List<org.junit.runners.model.FrameworkMethod> methodsWithNoData
List of FrameworkMethod that does not have any external test data associated with them.


methodsWithData

protected List<org.junit.runners.model.FrameworkMethod> methodsWithData
List of FrameworkMethod that does have any external test data associated with them.

Constructor Detail

BaseSuite

protected BaseSuite(Class<?> klass)
             throws org.junit.runners.model.InitializationError
Construct a new BaseSuite. The constructor is responsible for loading any test bean configurations provided by the user using TestConfigProvider, load any input test data provided using the DataLoader annotation, both at the class level as well as method level register any converters provide using Converters, both at the class level as well as method level.

Parameters:
klass - the class under test
Throws:
org.junit.runners.model.InitializationError - if any error occurs
Method Detail

getChildren

protected List<org.junit.runner.Runner> getChildren()
Get the children Runners

Overrides:
getChildren in class org.junit.runners.Suite
Returns:
a list of DataDrivenTestRunner

registerConverter

public void registerConverter(Converters converter)
Method responsible for registering the converters with the EasyTest framework

Parameters:
converter - the annotation Converters

withBeforeClasses

protected org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
Returns a Statement: We override this method as it was being called twice for the same class. Looks like a bug in JUnit.

Overrides:
withBeforeClasses in class org.junit.runners.ParentRunner<org.junit.runner.Runner>

withAfterClasses

protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
Returns a Statement: We override this method as it was being called twice for the same class. Looks like a bug in JUnit.

Overrides:
withAfterClasses in class org.junit.runners.ParentRunner<org.junit.runner.Runner>


Copyright © 2013. All Rights Reserved.