public class ParallelSuite extends WildcardPatternSuite
WildcardPatternSuite runner, which executes
its children classes concurrently. You can specify the maximum number
of parallel test threads using the system property maxParallelTestThreads.
If this system property is not specified, the maximum number of test threads
will be the number of available processors.
You can either explicitly list the children classes using the
@SuiteClasses annotation
provided by JUnit itself, like this:
@RunWith(ParallelSuite.class)
@SuiteClasses({
LoginFrontendTest.class,
FillOutFormFrontendTest.class,
...
})
public class AllFrontendTests {}
Or you can specify a wildcard pattern using the @SuiteClasses annotation
provided by JUnit Toolbox:
@RunWith(ParallelSuite.class)
@SuiteClasses("**/*FrontendTest.class")
public class AllFrontendTests {}
Note: Even if a test class annotated with @RunWith(ParallelSuite.class)
has a child class, which is also annotated with @RunWith(ParallelSuite.class)
or with @RunWith(ParallelRunner.class), there will never be
more test threads than specified (or the number of available processors), because
ParallelSuite and ParallelRunner share a singleton
fork join pool.| Constructor and Description |
|---|
ParallelSuite(Class<?> klass,
org.junit.runners.model.RunnerBuilder builder) |
describeChild, emptySuite, getChildren, runChildchildrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClassespublic ParallelSuite(Class<?> klass, org.junit.runners.model.RunnerBuilder builder) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorCopyright © 2017. All rights reserved.