Hi, I'm facing a classpath problem with JUnit:
My script is built this way : <target name="test" depends="compile"> <junit haltonfailure="no"> <classpath> <pathelement path="weblogic.jar"/> <pathelement path="[...]"/> </classpath> <formatter type="xml"/> <batchtest todir="${junit.reportDir}"> <fileset dir="${build.path.classes}"> <include name="**/*Test*.class"/> </fileset> </batchtest> </junit> </target> Some of my tests need some classes from weblogic.jar (6.1 at this time). So If don't mention weblogic.jar in the classpath of the <junit> task, these tests fail with a NoClassDefFoundError, but the other tests run well. But weblogic.jar also contains a bunch of things, including XML and DOM classes (which version??). So if I mention this file in my classpath, the <junit> task fails while generating my XML result files with this message : java.lang.LinkageError: loader constraints violated when linking org/w3c/dom/Document class at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source) at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.getDocumentBuilder(XMLJUnitResultFormatter.java:93) at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.startTestSuite(XMLJUnitResultFormatter.java:138) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireStartTestSuite(JUnitTestRunner.java:445) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:279) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:848) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:556) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:532) at org.apache.tools.ant.Task.perform(Task.java:341) [...] I try to prepend the classpath with another implementation of DOM, but I don't know which one to use. Also, I want to be certain that my tests use the same librairies as our production environment. Is there a way to make Ant use its classes to build the XML result files and make my tests work? Thanks, Didier _________________________________________________________________________________________________________ Ce message (et toutes les pièces jointes) sont confidentiels ; son contenu ne représente en aucun cas un engagement de la part de DEXIA SOFAXIS. Toute publication, utilisation ou diffusion, même partielle, doit être autorisée préalablement par l'émetteur. Si vous n'êtes pas destinataire de ce message, merci d'en avertir immédiatement l'expéditeur. Conformément aux dispositions de la loi n° 78-17 du 6 janvier 1978 relative à l'informatique, aux fichiers et aux libertés, vous pouvez obtenir communication et, le cas échéant, rectification ou suppression des informations vous concernant en vous adressant à DEXIA SOFAXIS - Route de Creton - 18110 VASSELAY _________________________________________________________________________________________________________ Consultez notre site internet http://www.sofaxis.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]