org.apache.tools.ant.taskdefs.optional.junit

Class BriefJUnitResultFormatter

public class BriefJUnitResultFormatter extends Object implements JUnitResultFormatter

Prints plain text output of the test to a specified Writer. Inspired by the PlainJUnitResultFormatter.

See Also: FormatterElement PlainJUnitResultFormatter

Constructor Summary
BriefJUnitResultFormatter()
Constructor for BriefJUnitResultFormatter.
Method Summary
voidaddError(Test test, Throwable error)
A test caused an error.
voidaddFailure(Test test, Throwable t)
Interface TestListener for JUnit <= 3.4.
voidaddFailure(Test test, AssertionFailedError t)
Interface TestListener for JUnit > 3.4.
voidendTest(Test test)
A test ended.
voidendTestSuite(JUnitTest suite)
The whole testsuite ended.
protected voidformatError(String type, Test test, Throwable error)
Format an error and print it.
protected StringformatTest(Test test)
Format the test for printing..
voidsetOutput(OutputStream out)
Sets the stream the formatter is supposed to write its results to.
voidsetSystemError(String err)
voidsetSystemOutput(String out)
voidstartTest(Test test)
A test started.
voidstartTestSuite(JUnitTest suite)
The whole testsuite started.

Constructor Detail

BriefJUnitResultFormatter

public BriefJUnitResultFormatter()
Constructor for BriefJUnitResultFormatter.

Method Detail

addError

public void addError(Test test, Throwable error)
A test caused an error.

Parameters: test a test error the error thrown by the test

addFailure

public void addFailure(Test test, Throwable t)
Interface TestListener for JUnit <= 3.4.

A Test failed.

Parameters: test a test t the exception thrown by the test

addFailure

public void addFailure(Test test, AssertionFailedError t)
Interface TestListener for JUnit > 3.4.

A Test failed.

Parameters: test a test t the assertion failed by the test

endTest

public void endTest(Test test)
A test ended.

Parameters: test a test

endTestSuite

public void endTestSuite(JUnitTest suite)
The whole testsuite ended.

formatError

protected void formatError(String type, Test test, Throwable error)
Format an error and print it.

Parameters: type the type of error test the test that failed error the exception that the test threw

formatTest

protected String formatTest(Test test)
Format the test for printing..

Parameters: test a test

Returns: the formatted testname

setOutput

public void setOutput(OutputStream out)
Sets the stream the formatter is supposed to write its results to.

Parameters: out the output stream to write to

setSystemError

public void setSystemError(String err)

See Also: setSystemError

setSystemOutput

public void setSystemOutput(String out)

See Also: setSystemOutput

startTest

public void startTest(Test test)
A test started.

Parameters: test a test

startTestSuite

public void startTestSuite(JUnitTest suite)
The whole testsuite started.
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.