public class WildcardPatternSuite
extends org.junit.runners.Suite
Suite and Categories,
which allows you to specify the children classes of your test suite class
using a wildcard pattern.
Example:
@RunWith(WildcardPatternSuite.class)
@SuiteClasses("**/*Test.class")
public class AllTests {}
You can also specify multiple patterns as well as exclude patterns:
@RunWith(WildcardPatternSuite.class)
@SuiteClasses({"**/*Test.class", "!gui/**"})
public class AllButGuiTests {}
Because it is also a replacement for the Categories runner,
you can use the standard JUnit annotations @IncludeCategory
and/or @ExcludeCategory:
@RunWith(WildcardPatternSuite.class)
@SuiteClasses("**/*Test.class")
@IncludeCategory(SlowTests.class)
public class OnlySlowTests {}
If you want to specify more than one category to include/exclude,
you can also use @IncludeCategories and/or
@ExcludeCategories annotations provided
by JUnit Toolbox:
@RunWith(WildcardPatternSuite.class)
@SuiteClasses("**/*Test.class")
@ExcludeCategories({SlowTests.class, FlakyTests.class})
public class NormalTests {}
| Constructor and Description |
|---|
WildcardPatternSuite(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 WildcardPatternSuite(Class<?> klass, org.junit.runners.model.RunnerBuilder builder) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorCopyright © 2017. All rights reserved.