It's a general rule of tasks found in optional.jar... Their dependencies
need to be in $ANT_HOME/lib! Ant is trying to do away with that requirement
thanks to antlib's, but it's not there yet (AFAIK).

As about JUnit 3.8 (recently released), it removed deprecated methods (like
TestCase#name, replaced by TestCase#getName and accompanied by the new
#setName method), and also changed the API of BaseTestRunner (breaking
backward compatibility right there!), so it's not surprising it might not
work with Ant 1.4.1 released more than a year earlier JUnit 3.8 was.

Hope that helps too. --DD

-----Original Message-----
From: Jacob Kjome [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 28, 2002 1:47 PM
To: Ant Users List
Subject: Re[2]: LinkageError while running junit task

Hello Dominique,

I have also noticed that JUnit needs to be loaded into the classpath
at the same time as the optional.jar...meaning that if optional.jar is
in $ANT_HOME/lib, that is where the JUnit.jar needs to be.  Also, it
seems that JUnit-3.8 only works with Ant-1.5+ and not Ant-1.4.1.

Hope that helps,

jake

Wednesday, August 28, 2002, 9:48:07 AM, you wrote:

DD> Add the fork='true' attribute, and that should solve it. Known bug. --DD

DD> -----Original Message-----
DD> From: Jiang, Bianca [mailto:[EMAIL PROTECTED]] 
DD> Sent: Wednesday, August 28, 2002 9:43 AM
DD> To: [EMAIL PROTECTED]
DD> Subject: LinkageError while running junit task

DD> Hi, I got the following error while running junit task, any hint there
what
DD> could be the cause?

DD> Thanks.  

DD> Bianca
DD> ==================================================================

DD> test:
DD>     [junit] Running AllTests

DD> BUILD FAILED
DD> java.lang.LinkageError: loader constraints violated when linking
DD> org/w3c/dom/Doc
DD> ument class
DD>         at
DD> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(
DD> DocumentBuilderFactoryImpl.java:88)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.
DD> getDocumentBuilder(XMLJUnitResultFormatter.java:93)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.
DD> startTestSuite(XMLJUnitResultFormatter.java:138)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireStar
DD> tTestSuite(JUnitTestRunner.java:433)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUni
DD> tTestRunner.java:279)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JU
DD> nitTask.java:804)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
DD> ask.java:551)
DD>         at
DD> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
DD> ask.java:527)
DD>         at org.apache.tools.ant.Task.perform(Task.java:317)
DD>         at org.apache.tools.ant.Target.execute(Target.java:309)
DD>         at org.apache.tools.ant.Target.performTasks(Target.java:334)
DD>         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
DD>         at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
DD>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
DD>         at org.apache.tools.ant.Main.start(Main.java:196)
DD>         at org.apache.tools.ant.Main.main(Main.java:235)

DD> My junit task looks like the following in my build file:

DD>                 <!-- task junit -->
DD>                 <junit printsummary="yes">

DD>                         <!-- Reference the path specified earlier in
"init"
DD> with its id as the classpath -->
DD>                         <classpath refid="project.test.path"/>

DD>                         <!-- Specify the format of the report to be xml
-->
DD>                         <formatter type="xml"/>

DD>                         <!-- Run a bunch of tests and create reports to
report directory -->>
DD>                         <batchtest todir="${report}${DSTAMP}">

DD>                                 <!-- Run all tests but test class called
DD> "*Suite" in the test directory -->
DD>                                 <fileset dir="${test}">
DD>                                         <include name="**/*.java"/>
DD>                                         <exclude name="**/*Suite.java"/>
DD>                                 </fileset>
DD>                         </batchtest>
                        
DD>                 </junit>

DD> --
DD> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
DD> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

DD> --
DD> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
DD> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



-- 
Best regards,
 Jacob                            mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to