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

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