org.junit.runners
Class Suite
java.lang.Object
org.junit.runner.Runner
org.junit.internal.runners.CompositeRunner
org.junit.runners.Suite
- All Implemented Interfaces:
- Filterable, Sortable
- Direct Known Subclasses:
- Enclosed
public class Suite
- extends org.junit.internal.runners.CompositeRunner
Using Suite
as a runner allows you to manually
build a suite containing tests from many classes. It is the JUnit 4 equivalent of the JUnit 3.8.x
static Test
suite()
method. To use it, annotate a class
with @RunWith(Suite.class)
and @SuiteClasses(TestClass1.class, ...)
.
When you run this class, it will run all the tests in all the suite classes.
Nested Class Summary |
static interface |
Suite.SuiteClasses
The SuiteClasses annotation specifies the classes to be run when a class
annotated with @RunWith(Suite.class) is run. |
Constructor Summary |
|
Suite(java.lang.Class<?> klass)
Internal use only. |
protected |
Suite(java.lang.Class<?> klass,
java.lang.Class<?>[] annotatedClasses)
|
Method Summary |
void |
run(RunNotifier notifier)
Run the tests for this runner. |
protected void |
validate(org.junit.internal.runners.MethodValidator methodValidator)
|
Methods inherited from class org.junit.internal.runners.CompositeRunner |
add, addAll, filter, getDescription, getName, getRunners, runChildren, sort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Suite
public Suite(java.lang.Class<?> klass)
throws org.junit.internal.runners.InitializationError
- Internal use only.
- Throws:
org.junit.internal.runners.InitializationError
Suite
protected Suite(java.lang.Class<?> klass,
java.lang.Class<?>[] annotatedClasses)
throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError
validate
protected void validate(org.junit.internal.runners.MethodValidator methodValidator)
run
public void run(RunNotifier notifier)
- Description copied from class:
Runner
- Run the tests for this runner.
- Overrides:
run
in class org.junit.internal.runners.CompositeRunner
- Parameters:
notifier
- will be notified of events while tests are being run--tests being
started, finishing, and failing