Class Overview
From a given set of test classes, runs only the classes and methods that are
annotated with either the category given with the @IncludeCategory
annotation, or a subtype of that category.
Note that, for now, annotating suites with @Category
has no effect.
Categories must be annotated on the direct method or class.
Example:
public interface FastTests {
}
public interface SlowTests {
}
public static class A {
@Test
public void a() {
fail();
}
@Category(SlowTests.class)
@Test
public void b() {
}
}
@Category( { SlowTests.class, FastTests.class })
public static class B {
@Test
public void c() {
}
}
@RunWith(Categories.class)
@IncludeCategory(SlowTests.class)
@SuiteClasses( { A.class, B.class })
// Note that Categories is a kind of Suite
public static class SlowTestSuite {
}
Summary
Nested Classes |
class |
Categories.CategoryFilter |
|
@interface |
Categories.ExcludeCategory |
|
@interface |
Categories.IncludeCategory |
|
[Expand]
Inherited Methods |
From class
org.junit.runners.Suite
|
From class
org.junit.runners.ParentRunner
Statement
|
childrenInvoker(RunNotifier notifier)
|
Statement
|
classBlock(RunNotifier notifier)
Constructs a Statement to run all of the tests in the test class.
|
void
|
collectInitializationErrors(List<Throwable> errors)
Adds to errors a throwable for each problem noted with the test class (available from getTestClass() ).
|
abstract
Description
|
describeChild(T child)
|
void
|
filter(Filter filter)
Remove tests that don't pass the parameter filter .
|
abstract
List<T>
|
getChildren()
Returns a list of objects that define the children of this Runner.
|
Description
|
getDescription()
|
String
|
getName()
Returns a name used to describe this Runner
|
final
TestClass
|
getTestClass()
Returns a TestClass object wrapping the class to be executed.
|
void
|
run(RunNotifier notifier)
Run the tests for this runner.
|
abstract
void
|
runChild(T child, RunNotifier notifier)
Runs the test corresponding to child , which can be assumed to be
an element of the list returned by getChildren() .
|
void
|
setScheduler(RunnerScheduler scheduler)
Sets a scheduler that determines the order and parallelization
of children.
|
void
|
sort(Sorter sorter)
Sorts the tests using sorter
|
void
|
validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors)
Adds to errors if any method in this class is annotated with
annotation , but:
- is not public, or
- takes parameters, or
- returns something other than void, or
- is static (given
isStatic is false ), or
- is not static (given
isStatic is true ).
|
Statement
|
withAfterClasses(Statement statement)
Returns a Statement : run all non-overridden @AfterClass methods on this class
and superclasses before executing statement ; all AfterClass methods are
always executed: exceptions thrown by previous steps are combined, if
necessary, with exceptions from AfterClass methods into a
MultipleFailureException .
|
Statement
|
withBeforeClasses(Statement statement)
Returns a Statement : run all non-overridden @BeforeClass methods on this class
and superclasses before executing statement ; if any throws an
Exception, stop execution and pass the exception on.
|
|
From class
org.junit.runner.Runner
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.junit.runner.Describable
|
From interface
org.junit.runner.manipulation.Filterable
abstract
void
|
filter(Filter filter)
Remove tests that don't pass the parameter filter .
|
|
From interface
org.junit.runner.manipulation.Sortable
abstract
void
|
sort(Sorter sorter)
Sorts the tests using sorter
|
|
Public Constructors