public class TextListener extends RunListener
RunListener.ThreadSafe
Constructor and Description |
---|
TextListener(JUnitSystem system) |
TextListener(PrintStream writer) |
Modifier and Type | Method and Description |
---|---|
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
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
public TextListener(JUnitSystem system)
public TextListener(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 runprotected void printHeader(long runTime)
protected void printFailures(Result result)
protected void printFooter(Result result)
protected String elapsedTimeAsString(long runTime)
Copyright © 2002–2021 JUnit. All rights reserved.