Java Reference
In-Depth Information
<target name="test" depends="compile">
<mkdir dir="${target.report.dir}"/>
<junit printsummary="yes" haltonerror="yes" haltonfailure="yes"
fork="yes">
<formatter type="xml"/>
<test name="junitbook.example.TestDefaultController"
todir="${target.report.dir}" />
<classpath>
<pathelement location="${target.classes.java.dir}"/>
<pathelement location="${target.classes.test.dir}"/>
</classpath>
</junit>
</target>
<target name="report" depends="test">
<mkdir dir="${target.report.dir}/html"/>
<junitreport todir="${target.report.dir}">
<fileset dir="${target.report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${target.report.dir}/html"/>
</junitreport>
</target>
</project>
First, we define a property for the location where the report will be generated B and
then create that directory C . We modify the junit task to output the test results as
C
D
E
F
G
H
I
J
Figure 9.3
Ant JUnit HTML report
Search WWH ::




Custom Search