类 TextListener
- java.lang.Object
- org.junit.runner.notification.RunListener
- org.junit.internal.TextListener
public class TextListener extends RunListener
嵌套类概要
从类继承的嵌套类/接口 org.junit.runner.notification.RunListener
RunListener.ThreadSafe
构造器概要
构造器 构造器 说明 TextListener(PrintStream writer)
TextListener(JUnitSystem system)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.protected void
printFailure(Failure each, String prefix)
protected void
printFailures(Result result)
protected void
printFooter(Result result)
protected void
printHeader(long runTime)
void
testFailure(Failure failure)
Called when an atomic test fails, or when a listener throws an exception.void
testIgnored(Description description)
Called when a test will not be run, generally because a test method is annotated withIgnore
.void
testRunFinished(Result result)
Called when all tests have finished.void
testStarted(Description description)
Called when an atomic test is about to be started.从类继承的方法 org.junit.runner.notification.RunListener
testAssumptionFailure, testFinished, testRunStarted
构造器详细资料
TextListener
public TextListener(JUnitSystem system)
TextListener
public TextListener(PrintStream writer)
方法详细资料
testRunFinished
public void testRunFinished(Result result)
从类复制的说明:RunListener
Called when all tests have finished. This may be called on an arbitrary thread.- 覆盖:
testRunFinished
在类中RunListener
- 参数:
result
- the summary of the test run, including all the tests that failed
testStarted
public void testStarted(Description description)
从类复制的说明:RunListener
Called when an atomic test is about to be started.- 覆盖:
testStarted
在类中RunListener
- 参数:
description
- the description of the test that is about to be run (generally a class and method name)
testFailure
public void testFailure(Failure failure)
从类复制的说明:RunListener
Called when an atomic test fails, or when a listener throws an exception.In the case of a failure of an atomic test, this method will be called with the same
Description
passed toRunListener.testStarted(Description)
, from the same thread that calledRunListener.testStarted(Description)
.In the case of a listener throwing an exception, this will be called with a
Description
ofDescription.TEST_MECHANISM
, and may be called on an arbitrary thread.- 覆盖:
testFailure
在类中RunListener
- 参数:
failure
- describes the test that failed and the exception that was thrown
testIgnored
public void testIgnored(Description description)
从类复制的说明:RunListener
Called when a test will not be run, generally because a test method is annotated withIgnore
.- 覆盖:
testIgnored
在类中RunListener
- 参数:
description
- describes the test that will not be run
printHeader
protected void printHeader(long runTime)
printFailures
protected void printFailures(Result result)
printFailure
protected void printFailure(Failure each, String prefix)
printFooter
protected void printFooter(Result result)
elapsedTimeAsString
protected String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time. Duplicated from BaseTestRunner. Fix it.