org.glassfish.pfl.test
Class XMLJUnitReportWriter

java.lang.Object
  extended by org.glassfish.pfl.test.XMLJUnitReportWriter
All Implemented Interfaces:
JUnitReportWriter, XMLConstants

public class XMLJUnitReportWriter
extends java.lang.Object
implements JUnitReportWriter, XMLConstants

Prints XML output of the test to a specified Writer.

See Also:
FormatterElement

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.glassfish.pfl.test.JUnitReportWriter
JUnitReportWriter.TestCounts, JUnitReportWriter.TestDescription
 
Field Summary
 
Fields inherited from interface org.glassfish.pfl.test.XMLConstants
ATTR_CLASSNAME, ATTR_ERRORS, ATTR_FAILURES, ATTR_ID, ATTR_MESSAGE, ATTR_NAME, ATTR_PACKAGE, ATTR_TESTS, ATTR_TIME, ATTR_TYPE, ATTR_VALUE, ERROR, FAILURE, HOSTNAME, PROPERTIES, PROPERTY, SYSTEM_ERR, SYSTEM_OUT, TESTCASE, TESTSUITE, TESTSUITES, TIMESTAMP
 
Constructor Summary
XMLJUnitReportWriter()
          No arg constructor.
XMLJUnitReportWriter(boolean filter)
           
 
Method Summary
 void addError(JUnitReportWriter.TestDescription test, java.lang.Throwable t)
          An error occurred.
 void addFailure(JUnitReportWriter.TestDescription test, java.lang.Throwable t)
          A failure occurred.
 void endTest(JUnitReportWriter.TestDescription test)
          A test ended.
 void endTest(JUnitReportWriter.TestDescription test, long duration)
          A test ended.
 org.w3c.dom.Element endTestHelper(JUnitReportWriter.TestDescription test)
           
 JUnitReportWriter.TestCounts endTestSuite()
          The whole testsuite ended.
 void setOutput(java.io.OutputStream out)
          Sets the stream the formatter is supposed to write its results to.
 void setSystemError(java.lang.String out)
          This is what the test has written to System.err
 void setSystemOutput(java.lang.String out)
          This is what the test has written to System.out
 void startTest(JUnitReportWriter.TestDescription t)
          A test started.
 void startTestSuite(java.lang.String name, java.util.Properties props)
          The whole testsuite started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLJUnitReportWriter

public XMLJUnitReportWriter()
No arg constructor.


XMLJUnitReportWriter

public XMLJUnitReportWriter(boolean filter)
Method Detail

setOutput

public void setOutput(java.io.OutputStream out)
Description copied from interface: JUnitReportWriter
Sets the stream the formatter is supposed to write its results to.

Specified by:
setOutput in interface JUnitReportWriter
Parameters:
out - the output stream to use.

setSystemOutput

public void setSystemOutput(java.lang.String out)
Description copied from interface: JUnitReportWriter
This is what the test has written to System.out

Specified by:
setSystemOutput in interface JUnitReportWriter
Parameters:
out - the string to write.

setSystemError

public void setSystemError(java.lang.String out)
Description copied from interface: JUnitReportWriter
This is what the test has written to System.err

Specified by:
setSystemError in interface JUnitReportWriter
Parameters:
out - the string to write.

startTestSuite

public void startTestSuite(java.lang.String name,
                           java.util.Properties props)
Description copied from interface: JUnitReportWriter
The whole testsuite started.

Specified by:
startTestSuite in interface JUnitReportWriter

endTestSuite

public JUnitReportWriter.TestCounts endTestSuite()
Description copied from interface: JUnitReportWriter
The whole testsuite ended.

Specified by:
endTestSuite in interface JUnitReportWriter

startTest

public void startTest(JUnitReportWriter.TestDescription t)
Description copied from interface: JUnitReportWriter
A test started.

Specified by:
startTest in interface JUnitReportWriter

endTest

public void endTest(JUnitReportWriter.TestDescription test,
                    long duration)
Description copied from interface: JUnitReportWriter
A test ended. Here we supply the duration, in case the duration is not determined by the [ startTest, endTest ] interval.

Specified by:
endTest in interface JUnitReportWriter

endTest

public void endTest(JUnitReportWriter.TestDescription test)
Description copied from interface: JUnitReportWriter
A test ended.

Specified by:
endTest in interface JUnitReportWriter

endTestHelper

public org.w3c.dom.Element endTestHelper(JUnitReportWriter.TestDescription test)

addFailure

public void addFailure(JUnitReportWriter.TestDescription test,
                       java.lang.Throwable t)
Description copied from interface: JUnitReportWriter
A failure occurred.

Specified by:
addFailure in interface JUnitReportWriter

addError

public void addError(JUnitReportWriter.TestDescription test,
                     java.lang.Throwable t)
Description copied from interface: JUnitReportWriter
An error occurred.

Specified by:
addError in interface JUnitReportWriter