source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/docs/manual/OptionalTasks/junitreport.html@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 4.4 KB
Line 
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>
10Merge the individual XML files generated by the JUnit task and eventually apply
11a stylesheet on the resulting merged document to provide a browsable report of
12the testcases results.
13<p><strong>Note:</strong> This task depends on external libraries not included in
14the Ant distribution. See <a href="../install.html#librarydependencies">
15Library Dependencies</a> for more information.</p>
16
17<h3>Requirements</h3>
18
19<p>The task needs Apache <a
20href="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
22version of XSLTC). Versions prior to Ant 1.6.2 worked with Apache <a
23href="http://archive.apache.org/dist/xml/xalan-j/">Xalan
241.2.2</a>, but as Xalan1 is no longer supported, we do not recommend
25this. With Ant 1.6.2 we had to decide between supporting Xalan-J 1
26and XSLTC, since there was no way to support both at the same
27time.</p>
28
29<p>If you want to use Xalan 1.2.2, the noframes report is still
30supposed to work. If you want the frames support, copy the file
31junit-frames-xalan1.xsl from the Ant distribution's etc directory to a
32new directory, change its name to junit-frames.xsl and use the task's
33styledir attribute to point to it. You will also need a compatible
34(older) version of Xerces. as well as BSF(bsf.jar). Again, using
35Xalan 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
60task using the nested <a href="../CoreTypes/fileset.html"><code>&lt;FileSet&gt;</code></a>
61element.</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 &quot;noframes&quot;
74 or &quot;frames&quot;.</td>
75 <td align="center" valign="top">No, default to &quot;frames&quot;</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>&lt;junitreport todir=&quot;./reports&quot;&gt;
98 &lt;fileset dir=&quot;./reports&quot;&gt;
99 &lt;include name=&quot;TEST-*.xml&quot;/&gt;
100 &lt;/fileset&gt;
101 &lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
102&lt;/junitreport&gt;
103</pre>
104</blockquote>
105<p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
106generate the default framed report in the directory <tt>report/html</tt>.</p>
107
108<hr>
109<p align="center">Copyright &copy; 2001-2002,2004 The Apache Software Foundation. All rights
110Reserved.</p>
111</body>
112
113</html>
Note: See TracBrowser for help on using the repository browser.