simonspoerri said:
i'm trying to find out a possibility to test my Junits regularly and
intend to solve this with Ant. is there a way to invoke a target in
the build.xml in a particular period?
thx for help i.a.!
Yes, Ant has a <junit> optional tag specfically for this purpose.
http://ant.apache.org/manual/index.html
the ant task might look something like this :
<target name="test" depends="">
<mkdir dir="${build.dir}/reports"/>
<!-- make the report output directory if required -->
<!-- Run Junit -->
<junit printsummary="withOutAndErr" fork="yes">
<!-- jars required for running the unit tests -->
<formatter type="xml"/>
<classpath>
<pathelement path="C:/JBuilder8/thirdparty/junit3.8/junit.jar"/>
<pathelement path="C:/JBuilder8/thirdparty/junit3.8/src.jar"/>
<pathelement path="${build.dir}/classes"/>
<path refid="unit.lib"/>
</classpath>
<!-- run the following tests -->
<test name="anttest.Testtoken" filtertrace="no"
todir="${build.dir}/reports"/>
<!-- <test name="anttest.testWeb" filtertrace="no"
todir="${build.dir}/reports" /> -->
</junit>