Browse Source

* Add a link to external dependency page.

* Remove unnecessary trailing spaces in junit.html.

Submitted by:
Ylan Segal <ylan@digiworks.tv>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271841 13f79535-47bb-0310-9956-ffa450edef68
master
Magesh Umasankar 23 years ago
parent
commit
b88e105282
2 changed files with 64 additions and 56 deletions
  1. +60
    -56
      docs/manual/OptionalTasks/junit.html
  2. +4
    -0
      docs/manual/OptionalTasks/junitreport.html

+ 60
- 56
docs/manual/OptionalTasks/junit.html View File

@@ -8,10 +8,14 @@
<h3>Description</h3>

<p>This task runs tests from the JUnit testing framework. The latest
version of the framework can be found at
version of the framework can be found at
<a href="http://www.junit.org">http://www.junit.org</a>.
This task has been tested with JUnit 3.0 up to JUnit 3.7, it won't
work with versions prior to JUnit 3.0.</p>
<p><strong>Note:</strong> This task depends on external libraries not included
in the Ant distribution. See <a href="../install.html#librarydependencies">
Library Dependencies</a> for more information.
</p>

<p>Tests are defined by nested <code>test</code> or
<code>batchtest</code> tags, see <a href="#nested">nested
@@ -25,7 +29,7 @@ elements</a>.</p>
<td width="10%" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">printsummary</td>
<td valign="top">printsummary</td>
<td valign="top">Print one line statistics for each testcase. Can
take the values &quot;on&quot;, &quot;off&quot; and
&quot;withOutAndErr&quot; - &quot;withOutAndErr&quot; is the same
@@ -34,43 +38,43 @@ elements</a>.</p>
<td align="center" valign="top">No, default is "off"</td>
</tr>
<tr>
<td valign="top">fork</td>
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.</td>
<td align="center" valign="top">No, default is "off"</td>
</tr>
<tr>
<td valign="top">haltonerror</td>
<td valign="top">haltonerror</td>
<td valign="top">Stop the build process if an error occurs during the test
run.</td>
<td align="center" valign="top">No, default is "off"</td>
</tr>
<tr>
<td valign="top">errorProperty</td>
<td valign="top">The name of a property to set in the event of an error.</td>
<td valign="top">errorProperty</td>
<td valign="top">The name of a property to set in the event of an error.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
considered failures as well).</td>
<td align="center" valign="top">No, default is "off"</td>
</tr>
<tr>
<td valign="top">failureProperty</td>
<td valign="top">failureProperty</td>
<td valign="top">The name of a property to set in the event of a failure
(errors are considered failures as well).</td>
(errors are considered failures as well).</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack traces.</td>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack traces.</td>
<td align="center" valign="top">No, default is "on."</td>
</tr>
<tr>
<td valign="top">timeout</td>
<td valign="top">timeout</td>
<td valign="top">Cancel the individual tests if the don't finish
in the given time (measured in milliseconds). Ignored if fork is
disabled.</td>
disabled.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
@@ -148,11 +152,11 @@ The attributes for this element are the same as for <a href="../CoreTasks/exec.h
available to the test.</p>


<h4>env</h4>
<h4>env</h4>

<p>It is possible to specify environment variables to pass to the
forked VM via nested <code>&lt;env&gt;</code> elements. See the
description in the section about
description in the section about
<a href="../CoreTasks/exec.html#env">exec</a></p>

<p>Settings will be ignored if fork is disabled.</p>
@@ -180,22 +184,22 @@ can be specified.</p>
<td width="10%" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">type</td>
<td valign="top">Use a predefined formatter (either
&quot;xml&quot;, &quot;plain&quot; or &quot;brief&quot;).</td>
<td align="center" rowspan="2">Exactly one of these.</td>
</tr>
<tr>
<td valign="top">classname</td>
<td valign="top">classname</td>
<td valign="top">Name of a custom formatter class.</td>
</tr>
<tr>
<td valign="top">extension</td>
<td valign="top">extension</td>
<td valign="top">Extension to append to the output filename.</td>
<td align="center">Yes, if classname has been used.</td>
</tr>
<tr>
<td valign="top">usefile</td>
<td valign="top">usefile</td>
<td valign="top">Boolean that determines whether output should be
sent to a file.</td>
<td align="center">No, default true.</td>
@@ -213,54 +217,54 @@ can be specified.</p>
<td width="10%" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">name</td>
<td valign="top">name</td>
<td valign="top">Name of the test class</td>
<td align="center">Yes</td>
</tr>
<tr>
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.
Overrides value set in <code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">haltonerror</td>
<td valign="top">haltonerror</td>
<td valign="top">Stop the build process if an error occurs during the test
run. Overrides value set in <code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">errorProperty</td>
<td valign="top">errorProperty</td>
<td valign="top">The name of a property to set in the event of an error.
Overrides value set in &lt;junit&gt;.</td>
Overrides value set in &lt;junit&gt;.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
considered failures as well). Overrides value set in
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
considered failures as well). Overrides value set in
<code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">failureProperty</td>
<td valign="top">failureProperty</td>
<td valign="top">The name of a property to set in the event of a failure
(errors are considered failures as well). Overrides value set in &lt;junit&gt;.</td>
(errors are considered failures as well). Overrides value set in &lt;junit&gt;.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack
traces. Overrides value set in &lt;junit&gt;</td>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack
traces. Overrides value set in &lt;junit&gt;</td>
<td align="center" valign="top">No, default is "on."</td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">todir</td>
<td valign="top">Directory to write the reports to.</td>
<td align="center" valign="top">No, default is current directory.</td>
</tr>
<tr>
<td valign="top">outfile</td>
<td valign="top">outfile</td>
<td valign="top">Base name of the test result. The full filename is
determined by this attribute and the extension of
<code>formatter</code>.</td>
@@ -268,12 +272,12 @@ can be specified.</p>
<code>TEST-name</code> using the <code>name</code> attribute.</td>
</tr>
<tr>
<td valign="top">if</td>
<td valign="top">if</td>
<td valign="top">Only run test if the named property is set.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">unless</td>
<td valign="top">unless</td>
<td valign="top">Only run test if the named property is <b>not</b> set.</td>
<td align="center" valign="top">No</td>
</tr>
@@ -299,54 +303,54 @@ generates a test class name for each file that ends in
<td width="10%" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.
<td valign="top">fork</td>
<td valign="top">Run the tests in a separate VM.
Overrides value set in <code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">haltonerror</td>
<td valign="top">haltonerror</td>
<td valign="top">Stop the build process if an error occurs during the test
run. Overrides value set in <code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">errorProperty</td>
<td valign="top">errorProperty</td>
<td valign="top">The name of a property to set in the event of an error.
Overrides value set in &lt;junit&gt;.</td>
Overrides value set in &lt;junit&gt;.</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
considered failures as well). Overrides value set in
<td valign="top">haltonfailure</td>
<td valign="top">Stop the build process if a test fails (errors are
considered failures as well). Overrides value set in
<code>&lt;junit&gt;</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">failureProperty</td>
<td valign="top">failureProperty</td>
<td valign="top">The name of a property to set in the event of a failure
(errors are considered failures as well). Overrides value set in &lt;junit&gt;</td>
(errors are considered failures as well). Overrides value set in &lt;junit&gt;</td>
<td align="center" valign="top">No.</td>
</tr>
<tr>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack
traces. Overrides value set in &lt;junit&gt;</td>
<td valign="top">filtertrace</td>
<td valign="top">Filter out junit and ant stack frames from error and failure stack
traces. Overrides value set in &lt;junit&gt;</td>
<td align="center" valign="top">No, default is "on."</td>
</tr>
<tr>
<td valign="top">todir</td>
<td valign="top">todir</td>
<td valign="top">Directory to write the reports to.</td>
<td align="center" valign="top">No, default is current directory.</td>
</tr>
<tr>
<td valign="top">if</td>
<td valign="top">if</td>
<td valign="top">Only run tests if the named property is set.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">unless</td>
<td valign="top">unless</td>
<td valign="top">Only run tests if the named property is <b>not</b> set.</td>
<td align="center" valign="top">No</td>
</tr>
@@ -416,7 +420,7 @@ perform setup work (such as starting an external server), execute the test,
clean up, and still fail the build in the event of a failure.</p>

<p>The filtertrace attribute condenses error and failure stack traces before reporting them.
It works with the plain and xml formatters. It filters out lines that begin with the following
It works with the plain and xml formatters. It filters out lines that begin with the following
string patterns:<pre>
"junit.framework.TestCase"
"junit.framework.TestResult"
@@ -426,7 +430,7 @@ string patterns:<pre>
"junit.awtui.TestRunner"
"junit.textui.TestRunner"
"java.lang.reflect.Method.invoke("
"org.apache.tools.ant."</pre></p>
"org.apache.tools.ant."</pre></p>
<hr>
<p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
Reserved.</p>


+ 4
- 0
docs/manual/OptionalTasks/junitreport.html View File

@@ -9,6 +9,10 @@
Merge the individual XML files generated by the JUnit task and eventually apply
a stylesheet on the resulting merged document to provide a browsable report of
the testcases results.
<p><strong>Note:</strong> This task depends on external libraries not included in
the Ant distribution. See <a href="../install.html#librarydependencies">
Library Dependencies</a> for more information.</p>

<h3>Requirements</h3>
<p>The task will run with either <a href="http://xml.apache.org/xalan-j/">Xalan 2.x</a>
or <a href="http://xml.apache.org/dist/xalan-j/old/xalan-j_1_2_2.zip">Xalan 1.2.2</a>.</p>


Loading…
Cancel
Save