[14982] | 1 | <html>
|
---|
| 2 | <head>
|
---|
| 3 | <title>JUnitReport Task</title>
|
---|
| 4 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
| 5 | </head>
|
---|
| 6 |
|
---|
| 7 | <body>
|
---|
| 8 |
|
---|
| 9 | <h2><a name="junitreport">JUnitReport</a></h2>
|
---|
| 10 | Merge the individual XML files generated by the JUnit task and eventually apply
|
---|
| 11 | a stylesheet on the resulting merged document to provide a browsable report of
|
---|
| 12 | the testcases results.
|
---|
| 13 | <p><strong>Note:</strong> This task depends on external libraries not included in
|
---|
| 14 | the Ant distribution. See <a href="../install.html#librarydependencies">
|
---|
| 15 | Library Dependencies</a> for more information.</p>
|
---|
| 16 |
|
---|
| 17 | <h3>Requirements</h3>
|
---|
| 18 |
|
---|
| 19 | <p>The task needs Apache <a
|
---|
| 20 | href="http://xml.apache.org/xalan-j/">Xalan 2.x or Xalan XSLTC</a>
|
---|
| 21 | (JDK 1.4 contains a version of Xalan-J 2.x while JDK 1.5 ships with a
|
---|
| 22 | version of XSLTC). Versions prior to Ant 1.6.2 worked with Apache <a
|
---|
| 23 | href="http://archive.apache.org/dist/xml/xalan-j/">Xalan
|
---|
| 24 | 1.2.2</a>, but as Xalan1 is no longer supported, we do not recommend
|
---|
| 25 | this. With Ant 1.6.2 we had to decide between supporting Xalan-J 1
|
---|
| 26 | and XSLTC, since there was no way to support both at the same
|
---|
| 27 | time.</p>
|
---|
| 28 |
|
---|
| 29 | <p>If you want to use Xalan 1.2.2, the noframes report is still
|
---|
| 30 | supposed to work. If you want the frames support, copy the file
|
---|
| 31 | junit-frames-xalan1.xsl from the Ant distribution's etc directory to a
|
---|
| 32 | new directory, change its name to junit-frames.xsl and use the task's
|
---|
| 33 | styledir attribute to point to it. You will also need a compatible
|
---|
| 34 | (older) version of Xerces. as well as BSF(bsf.jar). Again, using
|
---|
| 35 | Xalan 2 is simpler and supported.</p>
|
---|
| 36 |
|
---|
| 37 | <h3>Parameters</h3>
|
---|
| 38 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 39 | <tr>
|
---|
| 40 | <td width="12%" valign="top"><b>Attribute</b></td>
|
---|
| 41 | <td width="78%" valign="top"><b>Description</b></td>
|
---|
| 42 | <td width="10%" valign="top"><b>Required</b></td>
|
---|
| 43 | </tr>
|
---|
| 44 | <tr>
|
---|
| 45 | <td valign="top">tofile</td>
|
---|
| 46 | <td valign="top">The name of the XML file that will aggregate all individual
|
---|
| 47 | XML testsuite previously generated by the JUnit task.</td>
|
---|
| 48 | <td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
|
---|
| 49 | </tr>
|
---|
| 50 | <tr>
|
---|
| 51 | <td valign="top">todir</td>
|
---|
| 52 | <td valign="top">The directory where should be written the file resulting
|
---|
| 53 | from the individual XML testsuite aggregation.</td>
|
---|
| 54 | <td align="center" valign="top">No. Default to current directory</td>
|
---|
| 55 | </tr>
|
---|
| 56 | </table>
|
---|
| 57 | <h3><a name="nested">Nested Elements</a></h3>
|
---|
| 58 | <h4>fileset</h4>
|
---|
| 59 | <p><code>junitreport</code> collects individual xml files generated by the JUnit
|
---|
| 60 | task using the nested <a href="../CoreTypes/fileset.html"><code><FileSet></code></a>
|
---|
| 61 | element.</p>
|
---|
| 62 | <h4>report</h4>
|
---|
| 63 | <p>Generate a browsable report based on the document created by the merge.</p>
|
---|
| 64 | <h3>Parameters</h3>
|
---|
| 65 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 66 | <tr>
|
---|
| 67 | <td width="12%" valign="top"><b>Attribute</b></td>
|
---|
| 68 | <td width="78%" valign="top"><b>Description</b></td>
|
---|
| 69 | <td width="10%" valign="top"><b>Required</b></td>
|
---|
| 70 | </tr>
|
---|
| 71 | <tr>
|
---|
| 72 | <td valign="top">format</td>
|
---|
| 73 | <td valign="top">The format of the generated report. Must be "noframes"
|
---|
| 74 | or "frames".</td>
|
---|
| 75 | <td align="center" valign="top">No, default to "frames"</td>
|
---|
| 76 | </tr>
|
---|
| 77 | <tr>
|
---|
| 78 | <td valign="top">styledir</td>
|
---|
| 79 | <td valign="top">The directory where the stylesheets are defined. They must
|
---|
| 80 | be conforming to the following conventions:
|
---|
| 81 | <ul>
|
---|
| 82 | <li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>.</li>
|
---|
| 83 | <li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>.</li>
|
---|
| 84 | </ul>
|
---|
| 85 | </td>
|
---|
| 86 | <td align="center" valign="top">No. Default to embedded stylesheets.</td>
|
---|
| 87 | </tr>
|
---|
| 88 | <tr>
|
---|
| 89 | <td valign="top">todir</td>
|
---|
| 90 | <td valign="top">The directory where the files resulting from the
|
---|
| 91 | transformation should be written to.</td>
|
---|
| 92 | <td align="center" valign="top">No. Default to current directory</td>
|
---|
| 93 | </tr>
|
---|
| 94 | </table>
|
---|
| 95 | <h3>Example of report</h3>
|
---|
| 96 | <blockquote>
|
---|
| 97 | <pre><junitreport todir="./reports">
|
---|
| 98 | <fileset dir="./reports">
|
---|
| 99 | <include name="TEST-*.xml"/>
|
---|
| 100 | </fileset>
|
---|
| 101 | <report format="frames" todir="./report/html"/>
|
---|
| 102 | </junitreport>
|
---|
| 103 | </pre>
|
---|
| 104 | </blockquote>
|
---|
| 105 | <p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
|
---|
| 106 | generate the default framed report in the directory <tt>report/html</tt>.</p>
|
---|
| 107 |
|
---|
| 108 | <hr>
|
---|
| 109 | <p align="center">Copyright © 2001-2002,2004 The Apache Software Foundation. All rights
|
---|
| 110 | Reserved.</p>
|
---|
| 111 | </body>
|
---|
| 112 |
|
---|
| 113 | </html>
|
---|