optional.jar/ant.jar is missing in your junit classpath (junit classpath,
not ant classpath)
You unfortunately need to duplicate them.

<junit fork="yes" ...>
        <classpath>
                .....
                <!-- you need this -->
                <pathelement location="${ant.home}/lib/optional.jar"/>
                <pathelement location="${ant.home}/lib/ant.jar"/>

        </classpath>
</junit>

Make sure that your ant.home is an absolute path when it runs ant
Otherwise it will fail silently if your basedir is different from your
working dir for obvious path resolutions reasons since the path will be
resolved from the basedir instead of the working dir.

Hope it helps.

-- 
 Stéphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 17, 2001 11:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Ant 1.3, JUnit 3.6] Tests always fail
> 
> 
> 
> Hmmm... Not sure what I changed.  I'm getting a 
> NoClassDefFoundException
> now instead of the failure.
> 
> [junit] Executing: java
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTe
> stRunner test.hello.HelloWorldTest haltOnError=false 
> haltOnFailure=true
> [junit] java.lang.NoClassDefFoundError:
> org/apache/tools/ant/taskdefs/option
> al/junit/JUnitTestRunner
> 
> I echoed the LOCALCLASSPATH in ant.bat to make sure that the 
> optional jar
> was included and it was.  In fact, I dumped another jar I 
> needed in the lib
> directory and it worked fine.
> 
> Jason Yip
> Software Developer, ThoughtWorks, Inc
> http://www.thoughtworks.com
> (312) 560-4978 (cell)
> "It is not the strongest of the species that survive, nor the most
> intelligent, but the ones most responsive to change." -- 
> Charles Darwin
> 
> 
> 
>                                                               
>                                                      
>                     "Rakshit                                  
>                                                      
>                     Daga"                To:     
> <[EMAIL PROTECTED]>                                     
>                     <[EMAIL PROTECTED]        cc:                  
>                                                      
>                     edu>                 Subject:     Re: 
> [Ant 1.3, JUnit 3.6] Tests always fail                   
>                                                               
>                                                      
>                     05/17/2001                                
>                                                      
>                     11:49                                     
>                                                      
>                     Please                                    
>                                                      
>                     respond to                                
>                                                      
>                     ant-user                                  
>                                                      
>                                                               
>                                                      
>                                                               
>                                                      
> 
> 
> 
> 
> Try doing ant -verbose and see what java command the junit 
> task translates
> to ,
> and compare it with your java command
> 
> 
> 
> 
> 

Reply via email to