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.4 kB

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