Class ScanningSuite
- java.lang.Object
-
- org.junit.runner.Runner
-
- org.junit.runners.ParentRunner<org.junit.runner.Runner>
-
- org.junit.runners.Suite
-
- com.atlassian.confluence.util.test.ScanningSuite
-
- All Implemented Interfaces:
org.junit.runner.Describable
,org.junit.runner.manipulation.Filterable
,org.junit.runner.manipulation.Orderable
,org.junit.runner.manipulation.Sortable
public class ScanningSuite extends org.junit.runners.Suite
ASuite
that allows specifying patterns of names classes to include/exclude. Supports merging patterns specified in superclasses as well, to simplify writing focused test harnesses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ScanningSuite.Excludes
static interface
ScanningSuite.Filter
static interface
ScanningSuite.Includes
static interface
ScanningSuite.IncludeWithAnnotation
static interface
ScanningSuite.MustIncludes
static class
ScanningSuite.Ordering
static interface
ScanningSuite.TestOrdering
-
Constructor Summary
Constructors Constructor Description ScanningSuite(Class<?> annotatedClass, org.junit.runners.model.RunnerBuilder builder)
Called reflectively on classes annotated with@RunWith(Suite.class)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>[]
findMatchingTestClasses(ClassResolver classResolver, Class<?> annotatedClass)
Gets all matching annotations from the test class being run and its superclasses, and finds all matching classes on the classpath.-
Methods inherited from class org.junit.runners.Suite
describeChild, emptySuite, getChildren, runChild
-
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
-
-
-
-
Constructor Detail
-
ScanningSuite
public ScanningSuite(Class<?> annotatedClass, org.junit.runners.model.RunnerBuilder builder) throws org.junit.runners.model.InitializationError
Called reflectively on classes annotated with@RunWith(Suite.class)
- Parameters:
annotatedClass
- the root classbuilder
- builds runners for classes in the suite- Throws:
org.junit.runners.model.InitializationError
-
-
Method Detail
-
findMatchingTestClasses
public static Class<?>[] findMatchingTestClasses(ClassResolver classResolver, Class<?> annotatedClass)
Gets all matching annotations from the test class being run and its superclasses, and finds all matching classes on the classpath. This method is 'unsafe' in that it throws lots of exceptions that need to be handled.- Parameters:
annotatedClass
- the test class- Returns:
- the matching classes.
-
-