I am having problem with the latest Ant (checked out from cvs as of
1/31) when using the <junit> task. First off, if I use the default
"ant" script to execute a build file that uses <junit>, it would
complain that the task is not found and ask me to put the optional.jar
in the Ant's lib dir. I do have the optional jar in the directory
though.
I also tried to define the junit task manually using taskdef (note that
the junit.jar is in the ../lib directory relative to where the build.xml
is):
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="../../../../lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="../lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath refid="classpath"/>
</taskdef>
<target name="test">
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="classpath"/>
<formatter type="plain" />
<batchtest fork="yes" todir="${reports.tests}">
<fileset dir="${build.dest}">
<include name="**/test/*Test*.java" />
<exclude name="**/AllTests.java" />
</fileset>
</batchtest>
</junit>
</target>
I got the error reporting that the junit/framework/TestListener class is
not found. Is there anything wrong with the build file?
Thanks,
Will