public class TextListener extends RunListener
RunListener.ThreadSafe
Modifier and Type | Field and Description |
---|---|
private java.io.PrintStream |
writer |
Constructor and Description |
---|
TextListener(JUnitSystem system) |
TextListener(java.io.PrintStream writer) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.
|
private java.io.PrintStream |
getWriter() |
protected void |
printFailure(Failure each,
java.lang.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
with
Ignore . |
void |
testRunFinished(Result result)
Called when all tests have finished.
|
void |
testStarted(Description description)
Called when an atomic test is about to be started.
|
testAssumptionFailure, testFinished, testRunStarted, testSuiteFinished, testSuiteStarted
public TextListener(JUnitSystem system)
public TextListener(java.io.PrintStream writer)
public void testRunFinished(Result result)
RunListener
testRunFinished
in class RunListener
result
- the summary of the test run, including all the tests that failedpublic void testStarted(Description description)
RunListener
testStarted
in class RunListener
description
- the description of the test that is about to be run
(generally a class and method name)public void testFailure(Failure failure)
RunListener
In the case of a failure of an atomic test, this method will be called
with the same Description
passed to
RunListener.testStarted(Description)
, from the same thread that called
RunListener.testStarted(Description)
.
In the case of a listener throwing an exception, this will be called with
a Description
of Description.TEST_MECHANISM
, and may be called
on an arbitrary thread.
testFailure
in class RunListener
failure
- describes the test that failed and the exception that was thrownpublic void testIgnored(Description description)
RunListener
Ignore
.testIgnored
in class RunListener
description
- describes the test that will not be runprivate java.io.PrintStream getWriter()
protected void printHeader(long runTime)
protected void printFailures(Result result)
protected void printFailure(Failure each, java.lang.String prefix)
protected void printFooter(Result result)
protected java.lang.String elapsedTimeAsString(long runTime)