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 3.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 will run with either <a href="http://xml.apache.org/xalan-j/">Xalan 2.x</a>
  15. or <a href="http://xml.apache.org/dist/xalan-j/old/xalan-j_1_2_2.zip">Xalan 1.2.2</a>.</p>
  16. <p>
  17. Note:<i>For a framed format Xalan 1.2.2 will need Xerces(xerces.jar) as well as BSF(bsf.jar)
  18. that can be found in the distribution archive. Xerces will need to be before any other
  19. parser (such as the shipped crimson). It is *highly* recommended to use Xalan2 instead
  20. because Xalan1 is no more supported.
  21. </i></p>
  22. <h3>Parameters</h3>
  23. <table border="1" cellpadding="2" cellspacing="0">
  24. <tr>
  25. <td width="12%" valign="top"><b>Attribute</b></td>
  26. <td width="78%" valign="top"><b>Description</b></td>
  27. <td width="10%" valign="top"><b>Required</b></td>
  28. </tr>
  29. <tr>
  30. <td valign="top">tofile</td>
  31. <td valign="top">The name of the XML file that will aggregate all individual
  32. XML testsuite previously generated by the JUnit task.</td>
  33. <td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
  34. </tr>
  35. <tr>
  36. <td valign="top">todir</td>
  37. <td valign="top">The directory where should be written the file resulting
  38. from the individual XML testsuite aggregation.</td>
  39. <td align="center" valign="top">No. Default to current directory</td>
  40. </tr>
  41. </table>
  42. <h3><a name="nested">Nested Elements</a></h3>
  43. <h4>fileset</h4>
  44. <p><code>junitreport</code> collects individual xml files generated by the JUnit
  45. task using the nested <a href="../CoreTypes/fileset.html"><code>&lt;FileSet&gt;</code></a>
  46. element.</p>
  47. <h4>report</h4>
  48. <p>Generate a browsable report based on the document created by the merge.</p>
  49. <h3>Parameters</h3>
  50. <table border="1" cellpadding="2" cellspacing="0">
  51. <tr>
  52. <td width="12%" valign="top"><b>Attribute</b></td>
  53. <td width="78%" valign="top"><b>Description</b></td>
  54. <td width="10%" valign="top"><b>Required</b></td>
  55. </tr>
  56. <tr>
  57. <td valign="top">format</td>
  58. <td valign="top">The format of the generated report. Must be &quot;noframes&quot;
  59. or &quot;frames&quot;.</td>
  60. <td align="center" valign="top">No, default to &quot;frames&quot;</td>
  61. </tr>
  62. <tr>
  63. <td valign="top">styledir</td>
  64. <td valign="top">The directory where the stylesheets are defined. They must
  65. be conforming to the following conventions:
  66. <ul>
  67. <li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>.</li>
  68. <li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>.</li>
  69. </ul>
  70. </td>
  71. <td align="center" valign="top">No. Default to embedded stylesheets.</td>
  72. </tr>
  73. <tr>
  74. <td valign="top">todir</td>
  75. <td valign="top">The directory where the files resulting from the
  76. transformation should be written to.</td>
  77. <td align="center" valign="top">No. Default to current directory</td>
  78. </tr>
  79. </table>
  80. <h3>Example of report</h3>
  81. <blockquote>
  82. <pre>&lt;junitreport todir=&quot;./reports&quot;&gt;
  83. &lt;fileset dir=&quot;./reports&quot;&gt;
  84. &lt;include name=&quot;TEST-*.xml&quot;/&gt;
  85. &lt;/fileset&gt;
  86. &lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
  87. &lt;/junitreport&gt;
  88. </pre>
  89. </blockquote>
  90. <p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
  91. generate the default framed report in the directory <tt>report/html</tt>.</p>
  92. <hr>
  93. <p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
  94. Reserved.</p>
  95. </body>
  96. </html>