Class ScanningSuite

  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runner.Runner>
          extended by org.junit.runners.Suite
              extended by com.atlassian.confluence.util.test.ScanningSuite
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class ScanningSuite
extends org.junit.runners.Suite

A Suite 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
static interface ScanningSuite.Excludes
static interface ScanningSuite.Includes
static interface ScanningSuite.MustIncludes
Nested classes/interfaces inherited from class org.junit.runners.Suite
Constructor Summary
ScanningSuite(Class<?> annotatedClass, org.junit.runners.model.RunnerBuilder builder)
          Called reflectively on classes annotated with @RunWith(Suite.class)
Method Summary
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, collectInitializationErrors, filter, getDescription, getName, getTestClass, run, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
Methods inherited from class org.junit.runner.Runner
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


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)

annotatedClass - the root class
builder - builds runners for classes in the suite
Method Detail


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.

annotatedClass - the test class
the matching classes.
org.junit.runners.model.InitializationError - if there are missing annotations.
IOException - if there's a problem getting a File representation of a Resource.
ClassNotFoundException - if there's a problem loading a class.

Copyright © 2003-2013 Atlassian. All Rights Reserved.