程序包 org.junit.runner
类 Runner
- java.lang.Object
- org.junit.runner.Runner
- 所有已实现的接口:
Describable
- 直接已知子类:
org.junit.internal.runners.JUnit38ClassRunner
,ParentRunner
public abstract class Runner extends Object implements Describable
ARunner
runs tests and notifies aRunNotifier
of significant events as it does so. You will need to subclassRunner
when usingRunWith
to 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 theClass
containing 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.
- 从以下版本开始:
- 4.0
- 另请参阅:
Description
,RunWith
构造器详细资料
Runner
public Runner()
方法详细资料
getDescription
public abstract Description getDescription()
- 指定者:
getDescription
在接口中Describable
- 返回:
- a
Description
showing the tests to be run by the receiver
run
public abstract void run(RunNotifier notifier)
Run the tests for this runner.- 参数:
notifier
- will be notified of events while tests are being run--tests being started, finishing, and failing
testCount
public int testCount()
- 返回:
- the number of tests to be run by the receiver