public class DynamicSuite
extends org.junit.runners.ParentRunner<org.junit.runner.Runner>
@RunWith annotation, specifying DyanimcSuite.class as
the value in order to run a test class as a dynamic suite. TestCasePattern annotation.@Scenario annotation. Running tests as a scenario will cause all
of the resolved test cases' methods to be suffixed with the scenario name.@BeforeClass and @AfterClass
annotations may used to define setup and tear-down methods to be performed
before and after the entire suite, respectively.| Modifier and Type | Class and Description |
|---|---|
static interface |
DynamicSuite.Scenario
The
Scenario annotation is used to mark the dynamic suite
with a specific name that should be appended to each executed test name. |
static interface |
DynamicSuite.TestCasePattern
The
TestCasePattern annotation specifies the pattern from
which test case classes should be matched. |
| Modifier | Constructor and Description |
|---|---|
protected |
DynamicSuite(Class<?> klass,
Class<?>[] suiteClasses) |
protected |
DynamicSuite(Class<?> klass,
List<org.junit.runner.Runner> runners) |
|
DynamicSuite(Class<?> klass,
org.junit.runners.model.RunnerBuilder builder) |
|
DynamicSuite(org.junit.runners.model.RunnerBuilder builder,
Class<?>[] classes) |
protected |
DynamicSuite(org.junit.runners.model.RunnerBuilder builder,
Class<?> klass,
Class<?>[] suiteClasses) |
| Modifier and Type | Method and Description |
|---|---|
protected org.junit.runner.Description |
describeChild(org.junit.runner.Runner child) |
static List<Class<?>> |
findTestCases(Class<?> theClass)
Resolves the test classes that are matched by the specified test pattern.
|
static List<Class<?>> |
findTestCases(File classFolder,
String testCaseRegex)
Resolves the test classes that are matched by the specified test pattern.
|
protected List<org.junit.runner.Runner> |
getChildren() |
protected String |
getName() |
protected void |
runChild(org.junit.runner.Runner runner,
org.junit.runner.notification.RunNotifier notifier) |
public DynamicSuite(Class<?> klass, org.junit.runners.model.RunnerBuilder builder) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorpublic DynamicSuite(org.junit.runners.model.RunnerBuilder builder,
Class<?>[] classes)
throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorprotected DynamicSuite(Class<?> klass, Class<?>[] suiteClasses) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorprotected DynamicSuite(org.junit.runners.model.RunnerBuilder builder,
Class<?> klass,
Class<?>[] suiteClasses)
throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorpublic static List<Class<?>> findTestCases(Class<?> theClass)
theClass - the root class which defines the DynamicSuite; the
@TestCasePattern annotation will be used to
determine the pattern of test cases to include, and the root
folder will be determined based on the root folder for the
class-loader of theClass. - public static List<Class<?>> findTestCases(File classFolder, String testCaseRegex)
classFolder - the root folder under which to search for test casestestCaseRegex - the pattern to use when looking for test cases to include;
send null to use the value annotated on the class designated
by the class parameter.protected String getName()
getName in class org.junit.runners.ParentRunner<org.junit.runner.Runner>protected List<org.junit.runner.Runner> getChildren()
getChildren in class org.junit.runners.ParentRunner<org.junit.runner.Runner>protected org.junit.runner.Description describeChild(org.junit.runner.Runner child)
describeChild in class org.junit.runners.ParentRunner<org.junit.runner.Runner>protected void runChild(org.junit.runner.Runner runner,
org.junit.runner.notification.RunNotifier notifier)
runChild in class org.junit.runners.ParentRunner<org.junit.runner.Runner>Copyright © 2015 Glasnost. All Rights Reserved.