ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: [Ant 1.3, JUnit 3.6] Tests always fail
Date Fri, 18 May 2001 07:45:20 GMT

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: jcyip@thoughtworks.COM [mailto:jcyip@thoughtworks.COM]
> Sent: Thursday, May 17, 2001 11:57 PM
> To: ant-user@jakarta.apache.org
> 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:     
> <ant-user@jakarta.apache.org>                                     
>                     <daga@me.umn.        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
> 
> 
> 
> 
> 

Mime
View raw message