To have these in the test classpath, you can follow <em>either</em> of the following approaches:
</p>
<ul>
<li>Put all these relevant jars along with the <samp>ant-junitlauncher.jar</samp>
<ul id="setup">
<li id="setup-recommended"><b>Recommended approach since Ant 1.10.6</b>: Place the <samp>ant-junitlauncher.jar</samp> in <samp>ANT_HOME/lib</samp> directory
and use the nested <code><classpath></code> element to specify the location of the
the rest of the JUnit specific jars (noted above). Please read the
<a href=#nested-classpath>using classpath element</a> section for more details.</li>
<li>OR Put all these relevant jars along with the <samp>ant-junitlauncher.jar</samp>
in <samp>ANT_HOME/lib</samp> directory</li>
<li>OR Leave <samp>ant-junitlauncher.jar</samp> in the <samp>ANT_HOME/lib</samp> directory and
<li>OR Put <samp>ant-junitlauncher.jar</samp> in the <samp>ANT_HOME/lib</samp> directory and
include all other relevant jars in the classpath by passing them as a <kbd>-lib</kbd>
option, while invoking Ant</li>
<li>OR Use the nested <code><classpath></code> element to specify the location of the
test engines. For more details about this approach, please read the
<a href=#test-engine-in-classpath>using classpath element to include test engines</a> section.
</ul>
<p>
@@ -153,7 +156,7 @@
<h3 id="nested">Nested Elements</h3>
<h4>classpath</h4>
<h4 id="nested-classpath">classpath</h4>
<p>
The nested <code><classpath></code> element that represents
a <a href="../using.html#path">PATH like structure</a> can be used to configure the task to use
@@ -162,29 +165,16 @@
<ul>
<li>Finding the test classes to execute</li>
<li>Finding test engines that run the tests</li>
<li>If <a href="#setup-recommended">configured to do so</a>, finding all necessary JUnit libraries</li>
</ul>
<p>
If the <code>classpath</code> element isn't configured for the task, then the classpath of Ant
itself will be used for finding the test classes.
itself will be used for finding the test classes and the JUnit libraries.
</p>
<h5 id="test-engine-in-classpath">Using the classpath element to include test engines</h5>
<p>
The <code><classpath></code> can be used to include the test engines that you want to be
considered for execution of the tests.
</p>
<p>
<strong>NOTE:</strong> An important aspect to remember is that
whether or not you use this approach, the JUnit 5 platform libraries
<a href="#junit-platform-libraries">listed earlier in this
document</a> and the <code>ant-junitlauncher.jar</code>, <i>shouldn't</i> be part of this classpath
and instead they must be included in Ant runtime's classpath either by placing them
in <code>ANT_HOME/lib</code> or by passing the <code>-lib</code> option.
</p>
<p>
Below is an example of setting up the classpath to include the Jupiter test engine during the
execution of the tests. We assume that the JUnit 5 platform libraries and the
<code>ant-junitlauncher.jar</code> have been setup as explained previously.
Below is an example of setting up the classpath to include the Jupiter test engine and
the JUnit platform libraries during the execution of the tests.
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.