ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Forked junit task not finding TestRunner in optional jar
Date Thu, 14 Jun 2001 22:37:32 GMT
When you run it with fork="yes", you need to respecify the run-time
classpath, along with any additional classpath elements you need. If you
add a <pathelement path=${java.class.path}/>, you should be okay.

Diane

--- Dani Zweig <dani@laminarsoft.com> wrote:
> I have been trying to get the junit task to work.  Below is a try at
> running
> one of the junit sample test suites.
> 
> 	 <target name="tryjunit" depends="init">
> 		<junit printsummary="yes" fork="yes">
> 		       <classpath>
> 		          <pathelement location="${ROOT}/junit/3.5/junit3.5"/>
> 			    <pathelement location="${ROOT}/junit/3.5/junit.jar"/>
> 		       </classpath>
> 		    <formatter type="plain"/>
>   		    <test name="junit.samples.money.MoneyTest"
> outfile="test.results"/>
> 		</junit>
> 	 </target>
> 
> It works correctly if fork="no".  However, if fork="yes", as in the
> above
> snippet, I get the following error:
> 
>     [junit] Running junit.samples.money.MoneyTest
>     [junit] java.lang.NoClassDefFoundError:
> org/apache/tools/ant/taskdefs/option
> al/junit/JUnitTestRunner
>     [junit] TEST junit.samples.money.MoneyTest FAILED
> 
> Note that JunitTestRunner *is* in jakarta-ant-1.3-optional.jar, and that
> jar
> *is* in the ant lib directory (or the fork="no" case wouldn't work
> either).
> 
> Is the classpath not being passed to the forked jvm?  (I tried passing
> it
> via 'jvmarg', but that generated an "unrecognized option" error.)
> 
> advTHANKSance.
> 
> - Dani Zweig
>   dani@laminarsoft.com
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

Mime
View raw message