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

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