bodewig 2004/04/20 00:29:36
Modified: docs Tag: ANT_16_BRANCH faq.html
docs/manual/OptionalTasks Tag: ANT_16_BRANCH junit.html
xdocs Tag: ANT_16_BRANCH faq.xml
Log:
merge
Revision Changes Path
No revision
No revision
1.77.2.12 +31 -0 ant/docs/faq.html
Index: faq.html
===================================================================
RCS file: /home/cvs/ant/docs/faq.html,v
retrieving revision 1.77.2.11
retrieving revision 1.77.2.12
diff -u -r1.77.2.11 -r1.77.2.12
--- faq.html 14 Apr 2004 14:46:05 -0000 1.77.2.11
+++ faq.html 20 Apr 2004 07:29:35 -0000 1.77.2.12
@@ -345,6 +345,12 @@
can't seem to get the full stack trace.
</a></li>
+ <li><a href="#junit-no-runtime-xml">
+
+ Using format="xml", <junit> fails with a
+ <code>NoClassDefFoundError</code> if forked.
+
+ </a></li>
</ul>
<h3 class="section">Answers</h3>
@@ -1619,6 +1625,31 @@
<p>As a workaround, run your <java> task with
<code>fork="true"</code> and Ant will display the full
trace.</p>
+ <p class="faq">
+ <a name="junit-no-runtime-xml"></a>
+
+ Using format="xml", <junit> fails with a
+ <code>NoClassDefFoundError</code> if forked.
+
+ </p>
+ <p>The XML formatter needs the <a
href="http://www.w3.org/DOM/">DOM classes</a> to work. If you
+ are using JDK 1.4 or later they are included with your Java
+ Runtime and this problem won't occur. If you are running JDK
+ 1.3 or earlier, the DOM classes have to be on your
+ <junit> task's <classpath>.</p>
+ <p>Prior to Ant 1.6.0 Ant would include the DOM
classes from
+ the XML parser that is used by Ant itself if you set the
+ includeAntRuntime attribute to true (the default). With Ant
+ 1.6.0 this has been changed as this behavior made it
+ impossible to use a different XML parser in your tests.</p>
+ <p>This means that you have to take care of the DOM
classes
+ explicitly starting with Ant 1.6.0. If you don't need to set
+ up a different XML parser for your tests, the easiest solution
+ is to add</p>
+ <pre class="code">
+<pathelement
path="${ant.home}/lib/xml-apis.jar:${ant.home}/lib/xercesImpl.jar"/>
+</pre>
+ <p>to your task's <classpath>.</p>
</div>
</div>
No revision
No revision
1.30.2.4 +11 -1 ant/docs/manual/OptionalTasks/junit.html
Index: junit.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/OptionalTasks/junit.html,v
retrieving revision 1.30.2.3
retrieving revision 1.30.2.4
diff -u -r1.30.2.3 -r1.30.2.4
--- junit.html 9 Feb 2004 22:12:11 -0000 1.30.2.3
+++ junit.html 20 Apr 2004 07:29:36 -0000 1.30.2.4
@@ -133,7 +133,11 @@
<tr>
<td valign="top">includeantruntime</td>
<td valign="top">Implicitly add the Ant classes required to run
- the tests and JUnit to the classpath in forked mode.</td>
+ the tests and JUnit to the classpath in forked mode.
+ <b>Note:</b> Please read the <a
+ href="../../faq.html#junit-no-runtime-xml">Ant FAQ</a> if you
+ want to set this to <code>false</code> and use the XML formatter
+ at the same time.</td>
<td align="center" valign="top">No; default is <code>true</code>.</td>
</tr>
<tr>
@@ -282,6 +286,12 @@
<p>If you use the XML formatter, it may not include the same output
that your tests have written as some characters are illegal in XML
documents and will be dropped.</p>
+
+<p><b>Note:</b> Please read the <a
+href="../../faq.html#junit-no-runtime-xml">Ant FAQ</a> if you want to
+set the fork attribute to <code>true</code>, the includeAntRuntime
+attribute to <code>false</code> and use the XML formatter at the same
+time.</p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
No revision
No revision
1.38.2.12 +34 -0 ant/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/ant/xdocs/faq.xml,v
retrieving revision 1.38.2.11
retrieving revision 1.38.2.12
diff -u -r1.38.2.11 -r1.38.2.12
--- faq.xml 14 Apr 2004 14:46:05 -0000 1.38.2.11
+++ faq.xml 20 Apr 2004 07:29:36 -0000 1.38.2.12
@@ -1435,6 +1435,40 @@
trace.</p>
</answer>
</faq>
+
+ <faq id="junit-no-runtime-xml">
+ <question>
+ Using format="xml", <junit> fails with a
+ <code>NoClassDefFoundError</code> if forked.
+ </question>
+ <answer>
+
+ <p>The XML formatter needs the <a
+ href="http://www.w3.org/DOM/">DOM classes</a> to work. If you
+ are using JDK 1.4 or later they are included with your Java
+ Runtime and this problem won't occur. If you are running JDK
+ 1.3 or earlier, the DOM classes have to be on your
+ <junit> task's <classpath>.</p>
+
+ <p>Prior to Ant 1.6.0 Ant would include the DOM classes from
+ the XML parser that is used by Ant itself if you set the
+ includeAntRuntime attribute to true (the default). With Ant
+ 1.6.0 this has been changed as this behavior made it
+ impossible to use a different XML parser in your tests.</p>
+
+ <p>This means that you have to take care of the DOM classes
+ explicitly starting with Ant 1.6.0. If you don't need to set
+ up a different XML parser for your tests, the easiest solution
+ is to add</p>
+
+ <source><![CDATA[
+<pathelement
path="${ant.home}/lib/xml-apis.jar:${ant.home}/lib/xercesImpl.jar"/>
+]]></source>
+
+ <p>to your task's <classpath>.</p>
+
+ </answer>
+ </faq>
</faqsection>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]