+ <target name="compile_tests" depends="prepare-test,compile">
+ <javac destdir="${build.test.dest}" debug="true"
+ classpathref="test.classpath"
+ includeantruntime="false"
+ target="1.4"
+ source="1.4">
+ <src path="${build.test.src}"/>
+ </javac>
+ </target>
+
+ <target name="test" depends="compile_tests">
+ <antcall target="_run_tests">
+ <param name="classpathref" value="tests.classpath" />
+ </antcall>
+ </target>
+
+ <target name="_run_tests">
+ <junit fork="yes" forkmode="perTest" dir="${basedir}"
+ haltonerror="on" haltonfailure="on"
+ includeantruntime="true">
+ <classpath>
+ <path location="${build.dest}" />
+ <fileset dir="${lib.dir}" includes="*.jar,*.zip" />
+ <path location="${build.test.dest}" />
+ <path location="${build.dest}" />
+ <path location="${build.test.src}/junit-3.8.1.jar" />
+ </classpath>
+
+ <formatter type="plain" usefile="no" />
+
+ <test name="${testcase}" if="testcase" />
+
+ <batchtest unless="testcase">
+ <fileset dir="${build.test.dest}">
+ <include name="**/*Test.class" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+