William Lee <[EMAIL PROTECTED]> wrote:
> I'm using JUnit 3.5 and Ant 1.3b3.
Let me see
> <taskdef name="junit"
> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
> <classpath>
> <fileset dir="../lib">
> <include name="junit.jar"/>
> </fileset>
> </classpath>
> </taskdef>
this doesn't include the optional task itself, just JUnit.
> <!-- I was using this before, but didn't work also. My JUnit is
> in
> the ../lib directory.
> ANT_HOME is the current directory (where this build.xml is)
> <classpath refid="classpath"/>
> -->
This should work.
Could you please try the following snippet
<project name="dummy" basedir="." default="run-tests">
<path id="test">
<!-- here is JUnit 3.5 -->
<pathelement location="../lib/junit.jar" />
<!-- here is the optional task, adapt as necessary -->
<pathelement location="${ant.home}/lib/jakarta-ant-1.3-optional.jar" />
</path>
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath refid="test" />
</taskdef>
<target name="echo">
<property name="test" refid="test" />
<echo message="CLASSPATH for JUnit is ${test}" />
</target>
<target name="run-tests">
<!-- add the command for a single testcase here -->
<junit .... />
</target>
</project>
Confirm that all JARs are where you think they are. If all else fails,
run ant -debug (please use the released 1.3 version) and send the
output in private mail.
Stefan