junit.textui

Class ResultPrinter

Implemented Interfaces:
TestListener

public class ResultPrinter
extends java.lang.Object
implements TestListener

Constructor Summary

ResultPrinter(PrintStream writer)

Method Summary

void
addError(Test test, Throwable t)
void
addFailure(Test test, AssertionFailedError t)
protected String
elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time.
void
endTest(Test test)
PrintStream
getWriter()
void
printDefect(TestFailure booBoo, int count)
protected void
printDefectHeader(TestFailure booBoo, int count)
protected void
printDefectTrace(TestFailure booBoo)
protected void
printDefects(Enumeration booBoos, int count, String type)
protected void
printErrors(TestResult result)
protected void
printFailures(TestResult result)
protected void
printFooter(TestResult result)
protected void
printHeader(long runTime)
void
startTest(Test test)

Constructor Details

ResultPrinter

public ResultPrinter(PrintStream writer)

Method Details

addError

public void addError(Test test,
                     Throwable t)
Specified by:
addError in interface TestListener

See Also:
TestListener.addError(Test,Throwable)


addFailure

public void addFailure(Test test,
                       AssertionFailedError t)
Specified by:
addFailure in interface TestListener

See Also:
TestListener.addFailure(Test,AssertionFailedError)


elapsedTimeAsString

protected String elapsedTimeAsString(long runTime)
Returns the formatted string of the elapsed time. Duplicated from BaseTestRunner. Fix it.


endTest

public void endTest(Test test)
Specified by:
endTest in interface TestListener

See Also:
TestListener.endTest(Test)


getWriter

public PrintStream getWriter()


printDefect

public void printDefect(TestFailure booBoo,
                        int count)


printDefectHeader

protected void printDefectHeader(TestFailure booBoo,
                                 int count)


printDefectTrace

protected void printDefectTrace(TestFailure booBoo)


printDefects

protected void printDefects(Enumeration booBoos,
                            int count,
                            String type)


printErrors

protected void printErrors(TestResult result)


printFailures

protected void printFailures(TestResult result)


printFooter

protected void printFooter(TestResult result)


printHeader

protected void printHeader(long runTime)


startTest

public void startTest(Test test)
Specified by:
startTest in interface TestListener

See Also:
TestListener.startTest(Test)