Permalink
Browse files

Made ant target 'junit-test' produce a report like all the other

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...
1 parent cd50792 commit 83014159093a5b0b4de5c0673d6c6bfbaf918f28 @jayjwylie jayjwylie committed Sep 5, 2012
Showing with 16 additions and 3 deletions.
  1. +2 −0 build.properties
  2. +14 −3 build.xml
View
@@ -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
View
@@ -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.">

0 comments on commit 8301415

Please sign in to comment.