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]

Reply via email to