To perform the actions described in this topic, ensure that Apache Ant is installed on your machine.
To replay tests with Apache Ant, for example to generate HTML reports of the test runs, use the SilkTestSuite class. To replay keyword-driven tests with Apache Ant, use the KeywordTestSuite class. For additional information on replaying keyword-driven tests with Apache Ant, see Replaying Keyword-Driven Tests with Apache Ant.
@RunWith(SilkTestSuite.class)
@SuiteClasses({ MyTestClass1.class, MyTestClass2.class})
public class MyTestSuite {
}
<target name="runTests" depends="compile">
<mkdir dir="./reports"/>
<junit printsummary="true" showoutput="true" fork="true">
<classpath>
<fileset dir="${output}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${buildlib}">
<include name="**/*.jar" />
</fileset>
</classpath>
<test name="MyTestSuite" todir="./reports"/>
</junit>
</target>
For additional information about the
JUnit task, see
https://ant.apache.org/manual/Tasks/junit.html.
<formatter type="xml" />
<junitreport todir="./reports">
<fileset dir="./reports">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="./report/html" />
</junitreport>
For additional information about the
JUnitReport task, see
https://ant.apache.org/manual/Tasks/junitreport.html.
The complete target should now look like the following:
<target name="runTests" depends="compile">
<mkdir dir="./reports"/>
<junit printsummary="true" showoutput="true" fork="true">
<classpath>
<fileset dir="${output}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${buildlib}">
<include name="**/*.jar" />
</fileset>
</classpath>
<formatter type="xml" />
<test name="MyTestSuite" todir="./reports"/>
</junit>
<junitreport todir="./reports">
<fileset dir="./reports">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="./report/html" />
</junitreport>
</target>