2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2002-02-03 22:11:39 +00:00
|
|
|
<title>JUnitReport Task</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="junitreport">JUnitReport</a></h2>
|
|
|
|
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.
|
2002-03-14 01:01:18 +00:00
|
|
|
<p><strong>Note:</strong> This task depends on external libraries not included in
|
|
|
|
the Ant distribution. See <a href="../install.html#librarydependencies">
|
|
|
|
Library Dependencies</a> for more information.</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Requirements</h3>
|
2004-06-25 13:42:10 +00:00
|
|
|
|
|
|
|
<p>The task needs Apache <a
|
|
|
|
href="http://xml.apache.org/xalan-j/">Xalan 2.x or Xalan XSLTC</a>
|
|
|
|
(JDK 1.4 contains a version of Xalan-J 2.x while JDK 1.5 ships with a
|
|
|
|
version of XSLTC). Versions prior to Ant 1.6.2 worked with Apache <a
|
2004-06-25 13:43:10 +00:00
|
|
|
href="http://archive.apache.org/dist/xml/xalan-j/">Xalan
|
2004-06-25 13:42:10 +00:00
|
|
|
1.2.2</a>, but as Xalan1 is no longer supported, we do not recommend
|
|
|
|
this. With Ant 1.6.2 we had to decide between supporting Xalan-J 1
|
|
|
|
and XSLTC, since there was no way to support both at the same
|
|
|
|
time.</p>
|
|
|
|
|
|
|
|
<p>If you want to use Xalan 1.2.2, the noframes report is still
|
|
|
|
supposed to work. If you want the frames support, copy the file
|
|
|
|
junit-frames-xalan1.xsl from the Ant distribution's etc directory to a
|
|
|
|
new directory, change its name to junit-frames.xsl and use the task's
|
|
|
|
styledir attribute to point to it. You will also need a compatible
|
|
|
|
(older) version of Xerces. as well as BSF(bsf.jar). Again, using
|
|
|
|
Xalan 2 is simpler and supported.</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td width="12%" valign="top"><b>Attribute</b></td>
|
|
|
|
<td width="78%" valign="top"><b>Description</b></td>
|
|
|
|
<td width="10%" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">tofile</td>
|
|
|
|
<td valign="top">The name of the XML file that will aggregate all individual
|
|
|
|
XML testsuite previously generated by the JUnit task.</td>
|
|
|
|
<td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">todir</td>
|
|
|
|
<td valign="top">The directory where should be written the file resulting
|
|
|
|
from the individual XML testsuite aggregation.</td>
|
|
|
|
<td align="center" valign="top">No. Default to current directory</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h3><a name="nested">Nested Elements</a></h3>
|
|
|
|
<h4>fileset</h4>
|
|
|
|
<p><code>junitreport</code> collects individual xml files generated by the JUnit
|
2001-09-08 01:05:18 +00:00
|
|
|
task using the nested <a href="../CoreTypes/fileset.html"><code><FileSet></code></a>
|
2001-02-13 12:32:01 +00:00
|
|
|
element.</p>
|
|
|
|
<h4>report</h4>
|
|
|
|
<p>Generate a browsable report based on the document created by the merge.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td width="12%" valign="top"><b>Attribute</b></td>
|
|
|
|
<td width="78%" valign="top"><b>Description</b></td>
|
|
|
|
<td width="10%" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">format</td>
|
|
|
|
<td valign="top">The format of the generated report. Must be "noframes"
|
|
|
|
or "frames".</td>
|
|
|
|
<td align="center" valign="top">No, default to "frames"</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">styledir</td>
|
|
|
|
<td valign="top">The directory where the stylesheets are defined. They must
|
|
|
|
be conforming to the following conventions:
|
|
|
|
<ul>
|
2001-08-07 22:38:49 +00:00
|
|
|
<li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>.</li>
|
|
|
|
<li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>.</li>
|
2001-02-13 12:32:01 +00:00
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td align="center" valign="top">No. Default to embedded stylesheets.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">todir</td>
|
|
|
|
<td valign="top">The directory where the files resulting from the
|
|
|
|
transformation should be written to.</td>
|
|
|
|
<td align="center" valign="top">No. Default to current directory</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h3>Example of report</h3>
|
|
|
|
<blockquote>
|
|
|
|
<pre><junitreport todir="./reports">
|
|
|
|
<fileset dir="./reports">
|
|
|
|
<include name="TEST-*.xml"/>
|
|
|
|
</fileset>
|
|
|
|
<report format="frames" todir="./report/html"/>
|
|
|
|
</junitreport>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
<p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
|
|
|
|
generate the default framed report in the directory <tt>report/html</tt>.</p>
|
|
|
|
|
2002-01-10 08:48:33 +00:00
|
|
|
<hr>
|
2004-02-09 21:50:10 +00:00
|
|
|
<p align="center">Copyright © 2001-2002,2004 The Apache Software Foundation. All rights
|
2002-01-10 08:48:33 +00:00
|
|
|
Reserved.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|