conor 01/02/13 02:16:44
Modified: docs/manual/OptionalTasks Tag: ANT_13_BRANCH junit.html Log: Update to JUnit doco - fixing HTML tags to nest better/more pedantically Submitted by: Jesse Glick <[EMAIL PROTECTED]> Revision Changes Path No revision No revision 1.1.2.3 +42 -39 jakarta-ant/docs/manual/OptionalTasks/Attic/junit.html Index: junit.html =================================================================== RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/Attic/junit.html,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- junit.html 2001/02/10 23:34:45 1.1.2.2 +++ junit.html 2001/02/13 10:16:44 1.1.2.3 @@ -8,7 +8,7 @@ <p>This task runs tests from the JUnit testing framework. The latest version of the framework can be found at -<a href="http://www.junit.org" target="_top">http://www.junit.org</a>. +<a href="http://www.junit.org">http://www.junit.org</a>. This task requires JUnit 3.0 or above.</p> <p>Tests are defined by nested <code>test</code> or @@ -25,24 +25,24 @@ <tr> <td valign="top">printsummary</td> <td valign="top">Print one line statistics for each testcase.</td> - <td align="center" valign="top">No, default is "off"</td> + <td align="center" valign="top">No, default is "off"</td> </tr> <tr> <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> + <td align="center" valign="top">No, default is "off"</td> </tr> <tr> <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> + <td align="center" valign="top">No, default is "off"</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).</td> - <td align="center" valign="top">No, default is "off"</td> + <td align="center" valign="top">No, default is "off"</td> </tr> <tr> <td valign="top">timeout</td> @@ -81,16 +81,17 @@ <h4>jvmarg</h4> <p>If fork is enabled, additional parameters may be passed to the new -VM via nested <code><jvmarg></code> attributes, for example:</p> +VM via nested <code><jvmarg></code> attributes, for example: -<blockquote><pre> +<pre> <junit fork="yes"> <jvmarg value="-Djava.compiler=NONE"/> ... </junit> -</pre></blockquote> -<p>would run the test in a VM without JIT.</p> +</pre> +would run the test in a VM without JIT.</p> + <p><code><jvmarg></code> allows all attributes described in <a href="../using.html#arg">Command line arguments</a>.</p> @@ -99,15 +100,16 @@ <p>Use nested <code><sysproperty></code> elements to specify system properties required by the class. These properties will be made available to the VM during the execution of the test (either ANT's VM or the forked VM). -The attributes for this element are the same as for <a href="../CoreTasks/exec.html#env">environment variables</a>.</p> +The attributes for this element are the same as for <a href="../CoreTasks/exec.html#env">environment variables</a>. -<blockquote><pre> +<pre> <junit fork="no"> <sysproperty key="basedir" value="${basedir}"/> ... </junit> -</pre></blockquote> -<p>would run the test in ANT's VM and make the <code>basedir</code> property +</pre> + +would run the test in ANT's VM and make the <code>basedir</code> property available to the test.</p> @@ -117,7 +119,7 @@ formats. Output will always be sent to a file unless you set the usefile attribute to false, the name of the file is determined by the name of the test and can be set by the <code>outfile</code> attribute -of <code><test></code>.</p> +of <code><test></code>. <p>There are two predefined formatters, one prints the test results in XML format, the other emits plain text. Custom formatters that need to @@ -133,7 +135,7 @@ </tr> <tr> <td valign="top">type</td> - <td valign="top">Use a predefined formatter (either "xml" or "plain").</td> + <td valign="top">Use a predefined formatter (either "xml" or "plain").</td> <td align="center" rowspan="2">Exactly one of these.</td> </tr> <tr> @@ -221,7 +223,7 @@ <p><code>batchtest</code> collects the included files from any number of nested <a -href="index.html../CoreTypes/fileset.html"><code><fileset></code></a>s. It then +href="../CoreTypes/fileset.html"><code><fileset></code></a>s. It then generates a test class name for each file that ends in <code>.java</code> or <code>.class</code>.</p> @@ -271,51 +273,52 @@ <code><formatter></code> elements.</p> <h3>Examples</h3> -<blockquote><pre> + +<p><pre> <junit> - <test name="my.test.TestCase" /> + <test name="my.test.TestCase" /> </junit> -</pre></blockquote> +</pre> -<p>Runs the test defined in <code>my.test.TestCase</code> in the same +Runs the test defined in <code>my.test.TestCase</code> in the same VM. No output will be generated unless the test fails.</p> -<blockquote><pre> -<junit printsummary="yes" fork="yes" haltonfailure="yes"> - <formatter type="plain" /> - <test name="my.test.TestCase" /> +<p><pre> +<junit printsummary="yes" fork="yes" haltonfailure="yes"> + <formatter type="plain" /> + <test name="my.test.TestCase" /> </junit> -</pre></blockquote> +</pre> -<p>Runs the test defined in <code>my.test.TestCase</code> in a +Runs the test defined in <code>my.test.TestCase</code> in a separate VM. At the end of the test a single line summary will be printed. A detailed report of the test can be found in <code>TEST-my.test.TestCase.txt</code>. The build process will be stopped if the test fails.</p> -<blockquote><pre> -<junit printsummary="yes" haltonfailure="yes"> +<p><pre> +<junit printsummary="yes" haltonfailure="yes"> <classpath> - <pathelement location="${build.tests}" /> - <pathelement path="${java.class.path}" /> + <pathelement location="${build.tests}" /> + <pathelement path="${java.class.path}" /> </classpath> - <formatter type="plain" /> + <formatter type="plain" /> - <test name="my.test.TestCase" haltonfailure="no" outfile="result" > - <formatter type="xml" /> + <test name="my.test.TestCase" haltonfailure="no" outfile="result" > + <formatter type="xml" /> </test> - <batchtest fork="yes" todir="${reports.tests}"> - <fileset dir="${src.tests}"> - <include name="**/*Test*.java" /> - <exclude name="**/AllTests.java" /< + <batchtest fork="yes" todir="${reports.tests}"> + <fileset dir="${src.tests}"> + <include name="**/*Test*.java" /> + <exclude name="**/AllTests.java" /> </fileset> </batchtest> </junit> -</pre></blockquote> +</pre> -<p>Runs <code>my.test.TestCase</code> in the same VM (ignoring the +Runs <code>my.test.TestCase</code> in the same VM (ignoring the given CLASSPATH), only a warning is printed if this test fails. In addition to the plain text test results, for this test a XML result will be output to <code>result.xml</code>.</p>
