normal use

Change your ant build file to use junitour: add

<formatter usefile="true" classname="junitour.UnitourResultFormatter" extension=".xml"/>
<formatter usefile="false" classname="junitour.UnitourSummaryResultFormatter" />
to build.xml, an example from the junitour sources:

use with ant

To make use of the junitour lib in your own application, do the following:

  1. drop the junitour.jar file in your ant lib $ANT_HOME/lib/ directory
  2. make sure that following library is in your ANT's classpath: again: $ANT_HOME/lib/ directory
    • junitour.jar (3.8.1)
    This is normally already done, when you already work on junittests in your project ;-)
  3. example ant build file:
    <target name="internal-test" depends="compile-tests">
      <mkdir dir="${testreportdir}">
      </mkdir>
      <junit dir="./" failureproperty="test.failure" fork="true" haltonerror="false">
        <sysproperty key="basedir" value=".">
        </sysproperty>
        <formatter usefile="true" classname="junitour.UnitourResultFormatter" extension=".xml">
        </formatter>
        <formatter usefile="false" classname="junitour.UnitourSummaryResultFormatter"></formatter>
        <!--      <formatter usefile="false" type="plain"> </formatter>-->
        <classpath>
          <fileset dir="${libdir}">
            <include name="*.jar">
            </include>
          </fileset>
          <pathelement path="${testclassesdir}">
          </pathelement>
          <pathelement path="${classesdir}">
          </pathelement>
        </classpath>
        <batchtest todir="${testreportdir}">
          <fileset dir="${basedir}\src\java\test">
            <include name="**/*Test.java">
            </include>
          </fileset>
        </batchtest>
      </junit>
    </target>
  4. copy the new junit_noframes.xsl into the /conf/ directory
  5. use the extended styles for junit-report-generation:
    <junitreport todir="${testreportdir}" >
      <fileset dir="${testreportdir}" >
          <include name="TEST-*.xml"/>
      </fileset>
      <report format="noframes" styledir="${basedir}/conf" todir="${docdir}" />
    </junitreport> 
For more help with using ant in general, please see: http://ant.apache.org/