com.atlassian.confluence.util.test
Class ScanningSuite

java.lang.Object
  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
org.junit.runners.Suite.SuiteClasses
 
Constructor Summary
ScanningSuite(java.lang.Class<?> annotatedClass, org.junit.runners.model.RunnerBuilder builder)
          Called reflectively on classes annotated with @RunWith(Suite.class)
 
Method Summary
static java.lang.Class<?>[] findMatchingTestClasses(ClassResolver classResolver, java.lang.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
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScanningSuite

public ScanningSuite(java.lang.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 class
builder - builds runners for classes in the suite
Throws:
org.junit.runners.model.InitializationError
Method Detail

findMatchingTestClasses

public static java.lang.Class<?>[] findMatchingTestClasses(ClassResolver classResolver,
                                                           java.lang.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.
Throws:
org.junit.runners.model.InitializationError - if there are missing annotations.
java.io.IOException - if there's a problem getting a File representation of a Resource.
java.lang.ClassNotFoundException - if there's a problem loading a class.


Copyright © 2003-2014 Atlassian. All Rights Reserved.