Skip to content

Commit

Permalink
Made ant target 'junit-test' produce a report like all the other
Browse files Browse the repository at this point in the history
junit ant targets. The report is useful because for a test class
with many sub-tests, the report clearly explains which sub-tests
failed. Unlike other ant junit targets, this target also produce
a plain text report. The plain text report is useful for running
a single test in a loop until it fails.

Clarified the help message for the 'junit-test' ant target.
  • Loading branch information
jayjwylie committed Oct 9, 2012
1 parent cd50792 commit 8301415
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build.properties
Expand Up @@ -14,6 +14,8 @@ inttestsrc.dir=test/integration
testclasses.dir=dist/testclasses
testreport.dir=dist/junit-reports
testhtml.dir=dist/junit-reports/html
singletestreport.dir=dist/junit-single-reports
singletesthtml.dir=dist/junit-single-reports/html
longtestreport.dir=dist/junit-long-reports
longtesthtml.dir=dist/junit-long-reports/html

Expand Down
17 changes: 14 additions & 3 deletions build.xml
Expand Up @@ -419,11 +419,22 @@
</junitreport>
</target>

<target name="junit-test" depends="build, buildtest, contrib-jar" description="Run single junit test with -Dtest.name=">
<junit printsummary="yes" showoutput="true" maxmemory="1024m">
<target name="junit-test" depends="build, buildtest, contrib-jar" description="Run single junit test for class ClassName with -Dtest.name=[ClassName] (Note: Use the class name, not the file name with the .java extension)">
<replace-dir dir="${singletestreport.dir}" />
<replace-dir dir="${singletesthtml.dir}" />
<junit printsummary="on" showoutput="true" maxmemory="1024m">
<classpath refid="contrib-test-classpath" />
<test name="${test.name}" />
<classpath path="${log4j.properties.dir}" />
<formatter type="plain" />
<formatter type="xml" />
<test name="${test.name}" todir="${singletestreport.dir}"/>
</junit>
<junitreport todir="${singletesthtml.dir}">
<fileset dir="${singletestreport.dir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${singletesthtml.dir}" format="frames" />
</junitreport>
</target>

<target name="junit-all" depends="junit-long, contrib-junit" description="Run All junit tests including contrib.">
Expand Down

0 comments on commit 8301415

Please sign in to comment.