org.quilt.reports
Class XMLFormatter

java.lang.Object
  |
  +--org.quilt.reports.XMLFormatter
All Implemented Interfaces:
Formatter, junit.framework.TestListener

public class XMLFormatter
extends java.lang.Object
implements Formatter

Produce an XML document containing the test data for the run. This will in general contain the results of many tests, but only those resulting from one QuiltTest.


Constructor Summary
XMLFormatter()
           
 
Method Summary
 void addError(junit.framework.Test test, java.lang.Throwable t)
          Method called when an unexpected error occurs.
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
          Method called when a failure (or unexpected error) occurs.
 void addFailure(junit.framework.Test test, java.lang.Throwable t)
          Method called when a failure (or unexpected error) occurs.
 void endTest(junit.framework.Test test)
          Method called when a JUnit test ends.
 void endTestSuite(QuiltTest qt)
          Method called at end of test run.
protected static java.lang.String getTestName(junit.framework.Test test)
          Root around in a junit Test and find a name, should there be one.
 void setFiltertrace(boolean b)
          Enable filtering of Ant/Quilt/JUnit lines from stack traces.
 void setOutput(java.io.OutputStream out)
          Set the output file.
 void setRunner(Runner testrunner)
          Set the test runner to be used.
 void setSystemError(java.lang.String out)
          Direct the error output.
 void setSystemOutput(java.lang.String out)
          Direct standard output.
 void startTest(junit.framework.Test test)
          Called at the beginning of a JUnit test.
 void startTestSuite(QuiltTest qt)
          Method called at the beginning of the test run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLFormatter

public XMLFormatter()
Method Detail

getTestName

protected static java.lang.String getTestName(junit.framework.Test test)
Root around in a junit Test and find a name, should there be one.

Returns:
Test/suite name.

endTestSuite

public void endTestSuite(QuiltTest qt)
                  throws org.apache.tools.ant.BuildException
Method called at end of test run.

Specified by:
endTestSuite in interface Formatter
org.apache.tools.ant.BuildException

setFiltertrace

public void setFiltertrace(boolean b)
Enable filtering of Ant/Quilt/JUnit lines from stack traces.

Specified by:
setFiltertrace in interface Formatter

setOutput

public void setOutput(java.io.OutputStream out)
Set the output file.

Specified by:
setOutput in interface Formatter

setRunner

public void setRunner(Runner testrunner)
Set the test runner to be used.

Specified by:
setRunner in interface Formatter

setSystemError

public void setSystemError(java.lang.String out)
Direct the error output.

Specified by:
setSystemError in interface Formatter

setSystemOutput

public void setSystemOutput(java.lang.String out)
Direct standard output.

Specified by:
setSystemOutput in interface Formatter

startTestSuite

public void startTestSuite(QuiltTest qt)
Method called at the beginning of the test run.

Specified by:
startTestSuite in interface Formatter

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable t)
Method called when an unexpected error occurs.

Specified by:
addError in interface junit.framework.TestListener

addFailure

public void addFailure(junit.framework.Test test,
                       java.lang.Throwable t)
Method called when a failure (or unexpected error) occurs.


addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError t)
Method called when a failure (or unexpected error) occurs.

Specified by:
addFailure in interface junit.framework.TestListener

endTest

public void endTest(junit.framework.Test test)
Method called when a JUnit test ends.

Specified by:
endTest in interface junit.framework.TestListener

startTest

public void startTest(junit.framework.Test test)
Called at the beginning of a JUnit test.

Specified by:
startTest in interface junit.framework.TestListener


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.