Package org.junit.runner
Class Runner
- java.lang.Object
-
- org.junit.runner.Runner
-
- All Implemented Interfaces:
Describable
- Direct Known Subclasses:
org.junit.internal.runners.JUnit38ClassRunner,ParentRunner
public abstract class Runner extends java.lang.Object implements Describable
ARunnerruns tests and notifies aRunNotifierof significant events as it does so. You will need to subclassRunnerwhen usingRunWithto invoke a custom runner. When creating a custom runner, in addition to implementing the abstract methods here you must also provide a constructor that takes as an argument theClasscontaining the tests.The default runner implementation guarantees that the instances of the test case class will be constructed immediately before running the test and that the runner will retain no reference to the test case instances, generally making them available for garbage collection.
- Since:
- 4.0
- See Also:
Description,RunWith
-
-
Constructor Summary
Constructors Constructor Description Runner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DescriptiongetDescription()abstract voidrun(RunNotifier notifier)Run the tests for this runner.inttestCount()
-
-
-
Constructor Detail
-
Runner
public Runner()
-
-
Method Detail
-
getDescription
public abstract Description getDescription()
- Specified by:
getDescriptionin interfaceDescribable- Returns:
- a
Descriptionshowing the tests to be run by the receiver
-
run
public abstract void run(RunNotifier notifier)
Run the tests for this runner.- Parameters:
notifier- will be notified of events while tests are being run--tests being started, finishing, and failing
-
testCount
public int testCount()
- Returns:
- the number of tests to be run by the receiver
-
-