Thanks!
-----Original Message-----
From: Diane Holt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 14, 2001 6:38 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Forked junit task not finding TestRunner in optional jar
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 <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
>
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/