You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

junitreport.html 4.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <html>
  2. <head>
  3. <title>JUnitReport Task</title>
  4. </head>
  5. <body>
  6. <h2><a name="junitreport">JUnitReport</a></h2>
  7. Merge the individual XML files generated by the JUnit task and eventually apply
  8. a stylesheet on the resulting merged document to provide a browsable report of
  9. the testcases results.
  10. <p><strong>Note:</strong> This task depends on external libraries not included in
  11. the Ant distribution. See <a href="../install.html#librarydependencies">
  12. Library Dependencies</a> for more information.</p>
  13. <h3>Requirements</h3>
  14. <p>The task needs Apache <a
  15. href="http://xml.apache.org/xalan-j/">Xalan 2.4.1+ or Xalan XSLTC</a>
  16. (JDK 1.4 contains a version of Xalan-J 2.x while JDK 1.5 ships with a
  17. version of XSLTC). Starting from JDK 1.4.2-01 it ships with a bundled
  18. Xalan-J 2.4.1+, meaning that JDK version prior to 1.4.2-01 won't work
  19. out of the box. The table below summarize the compatibility status.
  20. </p>
  21. <table border="1" cellpadding="2" cellspacing="0">
  22. <tr><th>Xalan</th><th>Sun JDK Bundle</th><th>Status<th></tr>
  23. <tr><td>2.4.1+</td><td>JDK 1.4.2-01+</td><td>OK</td></tr>
  24. <tr><td>XSLTC</td><td>JDK 1.5.x</td><td>OK</td></tr>
  25. <tr><td>2.x</td><td>JDK 1.4.x</td><td>DEPRECATED<br /><i>Use ${ant.home}/etc/junit-frames-xalan1.xsl
  26. <br /> Upgrade Xalan using the JDK endorsement mechanism</i></td></tr>
  27. <tr><td>1.2</td><td>N/A</td><td>DEPRECATED<br /><i>Use ${ant.home}/etc/junit-frames-xalan1.xsl</i><td></tr>
  28. </table>
  29. <p>With Ant 1.6.2 we had to decide between supporting Xalan-J 1/Xalan J 2.4.1-
  30. and Xalan 2.4.1+/XSLTC, since there was no way to support both couples at the same
  31. time.</p>
  32. <h3>Parameters</h3>
  33. <table border="1" cellpadding="2" cellspacing="0">
  34. <tr>
  35. <td width="12%" valign="top"><b>Attribute</b></td>
  36. <td width="78%" valign="top"><b>Description</b></td>
  37. <td width="10%" valign="top"><b>Required</b></td>
  38. </tr>
  39. <tr>
  40. <td valign="top">tofile</td>
  41. <td valign="top">The name of the XML file that will aggregate all individual
  42. XML testsuite previously generated by the JUnit task.</td>
  43. <td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">todir</td>
  47. <td valign="top">The directory where should be written the file resulting
  48. from the individual XML testsuite aggregation.</td>
  49. <td align="center" valign="top">No. Default to current directory</td>
  50. </tr>
  51. </table>
  52. <h3><a name="nested">Nested Elements</a></h3>
  53. <h4>fileset</h4>
  54. <p><code>junitreport</code> collects individual xml files generated by the JUnit
  55. task using the nested <a href="../CoreTypes/fileset.html"><code>&lt;FileSet&gt;</code></a>
  56. element.</p>
  57. <h4>report</h4>
  58. <p>Generate a browsable report based on the document created by the merge.</p>
  59. <h3>Parameters</h3>
  60. <table border="1" cellpadding="2" cellspacing="0">
  61. <tr>
  62. <td width="12%" valign="top"><b>Attribute</b></td>
  63. <td width="78%" valign="top"><b>Description</b></td>
  64. <td width="10%" valign="top"><b>Required</b></td>
  65. </tr>
  66. <tr>
  67. <td valign="top">format</td>
  68. <td valign="top">The format of the generated report. Must be &quot;noframes&quot;
  69. or &quot;frames&quot;.</td>
  70. <td align="center" valign="top">No, default to &quot;frames&quot;</td>
  71. </tr>
  72. <tr>
  73. <td valign="top">styledir</td>
  74. <td valign="top">The directory where the stylesheets are defined. They must
  75. be conforming to the following conventions:
  76. <ul>
  77. <li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>.</li>
  78. <li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>.</li>
  79. </ul>
  80. </td>
  81. <td align="center" valign="top">No. Default to embedded stylesheets.</td>
  82. </tr>
  83. <tr>
  84. <td valign="top">todir</td>
  85. <td valign="top">The directory where the files resulting from the
  86. transformation should be written to.</td>
  87. <td align="center" valign="top">No. Default to current directory</td>
  88. </tr>
  89. </table>
  90. <h3>Example of report</h3>
  91. <blockquote>
  92. <pre>&lt;junitreport todir=&quot;./reports&quot;&gt;
  93. &lt;fileset dir=&quot;./reports&quot;&gt;
  94. &lt;include name=&quot;TEST-*.xml&quot;/&gt;
  95. &lt;/fileset&gt;
  96. &lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
  97. &lt;/junitreport&gt;
  98. </pre>
  99. </blockquote>
  100. <p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
  101. generate the default framed report in the directory <tt>report/html</tt>.</p>
  102. <hr>
  103. <p align="center">Copyright &copy; 2001-2002,2004 The Apache Software Foundation. All rights
  104. Reserved.</p>
  105. </body>
  106. </html>