Package org.junit.internal
Class TextListener
- java.lang.Object
-
- org.junit.runner.notification.RunListener
-
- org.junit.internal.TextListener
-
public class TextListener extends RunListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
RunListener.ThreadSafe
-
-
Constructor Summary
Constructors Constructor Description TextListener(java.io.PrintStream writer)TextListener(JUnitSystem system)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringelapsedTimeAsString(long runTime)Returns the formatted string of the elapsed time.protected voidprintFailure(Failure each, java.lang.String prefix)protected voidprintFailures(Result result)protected voidprintFooter(Result result)protected voidprintHeader(long runTime)voidtestFailure(Failure failure)Called when an atomic test fails, or when a listener throws an exception.voidtestIgnored(Description description)Called when a test will not be run, generally because a test method is annotated withIgnore.voidtestRunFinished(Result result)Called when all tests have finished.voidtestStarted(Description description)Called when an atomic test is about to be started.-
Methods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testFinished, testRunStarted, testSuiteFinished, testSuiteStarted
-
-
-
-
Constructor Detail
-
TextListener
public TextListener(JUnitSystem system)
-
TextListener
public TextListener(java.io.PrintStream writer)
-
-
Method Detail
-
testRunFinished
public void testRunFinished(Result result)
Description copied from class:RunListenerCalled when all tests have finished. This may be called on an arbitrary thread.- Overrides:
testRunFinishedin classRunListener- Parameters:
result- the summary of the test run, including all the tests that failed
-
testStarted
public void testStarted(Description description)
Description copied from class:RunListenerCalled when an atomic test is about to be started.- Overrides:
testStartedin classRunListener- Parameters:
description- the description of the test that is about to be run (generally a class and method name)
-
testFailure
public void testFailure(Failure failure)
Description copied from class:RunListenerCalled 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
Descriptionpassed 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
DescriptionofDescription.TEST_MECHANISM, and may be called on an arbitrary thread.- Overrides:
testFailurein classRunListener- Parameters:
failure- describes the test that failed and the exception that was thrown
-
testIgnored
public void testIgnored(Description description)
Description copied from class:RunListenerCalled when a test will not be run, generally because a test method is annotated withIgnore.- Overrides:
testIgnoredin classRunListener- Parameters:
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, java.lang.String prefix)
-
printFooter
protected void printFooter(Result result)
-
elapsedTimeAsString
protected java.lang.String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time. Duplicated from BaseTestRunner. Fix it.
-
-