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.8 KiB

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