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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. </table>
  29. <p>With Ant 1.6.2 we had to decide between supporting Xalan-J 1/Xalan J 2.4.1-
  30. and Xalan 2.4.1+/XSLTC, since there was no way to support both couples at the same
  31. time.</p>
  32. <p>With Ant 1.7 we had to drop support Xalan-J 1, since Xalan-J 1 has not
  33. available anymore for quite some time.</p>
  34. <h3>Parameters</h3>
  35. <table border="1" cellpadding="2" cellspacing="0">
  36. <tr>
  37. <td width="12%" valign="top"><b>Attribute</b></td>
  38. <td width="78%" valign="top"><b>Description</b></td>
  39. <td width="10%" valign="top"><b>Required</b></td>
  40. </tr>
  41. <tr>
  42. <td valign="top">tofile</td>
  43. <td valign="top">The name of the XML file that will aggregate all individual
  44. XML testsuite previously generated by the JUnit task.</td>
  45. <td align="center" valign="top">No. Default to TESTS-TestSuites.xml</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">todir</td>
  49. <td valign="top">The directory where should be written the file resulting
  50. from the individual XML testsuite aggregation.</td>
  51. <td align="center" valign="top">No. Default to current directory</td>
  52. </tr>
  53. </table>
  54. <h3><a name="nested">Nested Elements</a></h3>
  55. <h4>fileset</h4>
  56. <p><code>junitreport</code> collects individual xml files generated by the JUnit
  57. task using the nested <a href="../CoreTypes/fileset.html"><code>&lt;FileSet&gt;</code></a>
  58. element.</p>
  59. <h4>report</h4>
  60. <p>Generate a browsable report based on the document created by the merge.</p>
  61. <h3>Parameters</h3>
  62. <table border="1" cellpadding="2" cellspacing="0">
  63. <tr>
  64. <td width="12%" valign="top"><b>Attribute</b></td>
  65. <td width="78%" valign="top"><b>Description</b></td>
  66. <td width="10%" valign="top"><b>Required</b></td>
  67. </tr>
  68. <tr>
  69. <td valign="top">format</td>
  70. <td valign="top">The format of the generated report. Must be &quot;noframes&quot;
  71. or &quot;frames&quot;.</td>
  72. <td align="center" valign="top">No, default to &quot;frames&quot;</td>
  73. </tr>
  74. <tr>
  75. <td valign="top">styledir</td>
  76. <td valign="top">The directory where the stylesheets are defined. They must
  77. be conforming to the following conventions:
  78. <ul>
  79. <li>frames format: the stylesheet must be named <i>junit-frames.xsl</i>.</li>
  80. <li>noframes format: the stylesheet must be named <i>junit-noframes.xsl</i>.</li>
  81. </ul>
  82. </td>
  83. <td align="center" valign="top">No. Default to embedded stylesheets.</td>
  84. </tr>
  85. <tr>
  86. <td valign="top">todir</td>
  87. <td valign="top">The directory where the files resulting from the
  88. transformation should be written to.</td>
  89. <td align="center" valign="top">No. Default to current directory</td>
  90. </tr>
  91. </table>
  92. <h3>Example of report</h3>
  93. <blockquote>
  94. <pre>&lt;junitreport todir=&quot;./reports&quot;&gt;
  95. &lt;fileset dir=&quot;./reports&quot;&gt;
  96. &lt;include name=&quot;TEST-*.xml&quot;/&gt;
  97. &lt;/fileset&gt;
  98. &lt;report format=&quot;frames&quot; todir=&quot;./report/html&quot;/&gt;
  99. &lt;/junitreport&gt;
  100. </pre>
  101. </blockquote>
  102. <p>would generate a <tt>TESTS-TestSuites.xml</tt> file in the directory <tt>reports</tt> and
  103. generate the default framed report in the directory <tt>report/html</tt>.</p>
  104. <hr>
  105. <p align="center">Copyright &copy; 2001-2002,2004-2005 The Apache Software Foundation. All rights
  106. Reserved.</p>
  107. </body>
  108. </html>