JUnitReport

Merge the individual XML files generated by the JUnit task and eventually apply a stylesheet on the resulting merged document to provide a browsable report of the testcases results.

Note: This task depends on external libraries not included in the Ant distribution. See Library Dependencies for more information.

Requirements

The task needs Xalan 2.x; although Xalan 1.2.2 does work, but as Xalan1 is not supported, we do not recommend this.

If you do you use Xalan 1.2.2 you will need a compatible (older) version of Xerces. as well as BSF(bsf.jar). Again, using Xalan 2 is simpler and supported.

Parameters

Attribute Description Required
tofile The name of the XML file that will aggregate all individual XML testsuite previously generated by the JUnit task. No. Default to TESTS-TestSuites.xml
todir The directory where should be written the file resulting from the individual XML testsuite aggregation. No. Default to current directory

Nested Elements

fileset

junitreport collects individual xml files generated by the JUnit task using the nested <FileSet> element.

report

Generate a browsable report based on the document created by the merge.

Parameters

Attribute Description Required
format The format of the generated report. Must be "noframes" or "frames". No, default to "frames"
styledir The directory where the stylesheets are defined. They must be conforming to the following conventions:
  • frames format: the stylesheet must be named junit-frames.xsl.
  • noframes format: the stylesheet must be named junit-noframes.xsl.
No. Default to embedded stylesheets.
todir The directory where the files resulting from the transformation should be written to. No. Default to current directory

Example of report

<junitreport todir="./reports">
  <fileset dir="./reports">
    <include name="TEST-*.xml"/>
  </fileset>
  <report format="frames" todir="./report/html"/>
</junitreport>

would generate a TESTS-TestSuites.xml file in the directory reports and generate the default framed report in the directory report/html.


Copyright © 2001-2002,2004 The Apache Software Foundation. All rights Reserved.