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]