blob: 15e78a50f1537f2ed44e911c968b235367f5e28c [file] [log] [blame]
<project name="testng" default="all" basedir="../..">
<property file="build.properties"/>
<property name="this.directory" value="test/ant" />
<property name="test-output" value="${this.directory}/test-output" />
<taskdef name="testng" classname="org.testng.TestNGAntTask"
classpath="${jdk15.testng.jar}" />
<target name="all">
<delete failonerror="false" dir="${this.directory}/build" />
<mkdir dir="${this.directory}/build" />
<javac classpath="${jdk15.testng.jar}"
destdir="${this.directory}/build" srcdir="${this.directory}" includes="*.java" />
<!--
<testng classpath="build;../../testng-5.2beta-jdk15.jar"
outputdir="test-output"
dumpcommand="true">
<xmlfileset dir="." includes="testng.xml"/>
</testng>
-->
<delete failonerror="false">
<fileset dir="${test-output}" includes="**"/></delete>
<testng classpath="${this.directory}/build;${jdk15.testng.jar}"
outputdir="${test-output}"
parallel="methods"
threadcount="5"
listeners = "org.testng.reporters.FailedReporter, org.testng.reporters.DotTestListener"
haltonfailure="true"
>
<classfileset dir="${this.directory}/build">
<include name="NoPackageTest.class" />
<include name="MultipleThreadTest.class" />
</classfileset>
</testng>
<available file="${test-output}/Ant suite/Ant test.xml"
type="file" property="test.exists"/>
<fail unless="test.exists"
message="The appropriately named output should have been created"/>
<testng classpath="${this.directory}/build;${jdk15.testng.jar}"
outputdir="${test-output}"
listeners = "org.testng.reporters.FailedReporter, org.testng.reporters.DotTestListener"
haltonfailure="true"
suitename="Test Ant Suite"
testname="Test Ant Test"
>
<classfileset dir="${this.directory}/build">
<include name="DontOverrideSuiteNameTest.class" />
</classfileset>
</testng>
<available file="${test-output}/Test Ant Suite/Test Ant Test.xml"
type="file" property="test2.exists"/>
<fail unless="test2.exists" message="The appropriately named output should have been created"/>
<!-- Ensure standard tests get run -->
<testng classpath="${this.directory}/build;${jdk15.testng.jar}"
outputdir="${test-output}"
listeners = "org.testng.reporters.FailedReporter, org.testng.reporters.DotTestListener"
haltonfailure="true"
>
<xmlfileset file="${this.directory}/testng.xml"/>
</testng>
<available file="${test-output}/Suitename from xml/TestName.xml"
type="file" property="test3.exists"/>
<fail unless="test3.exists" message="The appropriately named output should have been created"/>
</target>
</project>