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

Class XMLJUnitResultFormatter

public class XMLJUnitResultFormatter extends Object implements JUnitResultFormatter, XMLConstants

Prints XML output of the test to a specified Writer.

See Also: FormatterElement

Constructor Summary
XMLJUnitResultFormatter()
No arg constructor.
Method Summary
voidaddError(Test test, Throwable t)
Interface TestListener.
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)
Interface TestListener.
voidendTestSuite(JUnitTest suite)
The whole testsuite ended.
voidsetOutput(OutputStream out)
{@inheritDoc}.
voidsetSystemError(String out)
{@inheritDoc}.
voidsetSystemOutput(String out)
{@inheritDoc}.
voidstartTest(Test t)
Interface TestListener.
voidstartTestSuite(JUnitTest suite)
The whole testsuite started.

Constructor Detail

XMLJUnitResultFormatter

public XMLJUnitResultFormatter()
No arg constructor.

Method Detail

addError

public void addError(Test test, Throwable t)
Interface TestListener.

An error occurred while running the test.

Parameters: test the test. t the error.

addFailure

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

A Test failed.

Parameters: test the test. t the exception.

addFailure

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

A Test failed.

Parameters: test the test. t the assertion.

endTest

public void endTest(Test test)
Interface TestListener.

A Test is finished.

Parameters: test the test.

endTestSuite

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

Parameters: suite the testsuite.

Throws: BuildException on error.

setOutput

public void setOutput(OutputStream out)
{@inheritDoc}.

setSystemError

public void setSystemError(String out)
{@inheritDoc}.

setSystemOutput

public void setSystemOutput(String out)
{@inheritDoc}.

startTest

public void startTest(Test t)
Interface TestListener.

A new Test is started.

Parameters: t the test.

startTestSuite

public void startTestSuite(JUnitTest suite)
The whole testsuite started.

Parameters: suite the testsuite.