<?xml version="1.0"?> <project name="java-test" basedir="." default="foo"> <!-- this property gets overridden programmatically--> <property name="timeToWait" value="4"/> <!-- this property gets overridden programmatically--> <property name="logFile" value="spawn.log"/> <property name="app" value="org.apache.tools.ant.taskdefs.JavaTest$$EntryPoint" /> <property name="app2" value="org.apache.tools.ant.taskdefs.JavaTest$$ExceptingEntryPoint" /> <property name="spawnapp" value="org.apache.tools.ant.taskdefs.JavaTest$$SpawnEntryPoint" /> <path id="test.classpath"> <pathelement location="${build.tests}"/> </path> <target name="testNoJarNoClassname"> <java/> </target> <target name="testJarNoFork"> <java jar="test.jar" fork="false"/> </target> <target name="testJarAndClassName"> <java jar="test.jar" classname="${app}" /> </target> <target name="testClassnameAndJar"> <java classname="${app}" jar="test.jar" /> </target> <target name="testRun"> <fail unless="tests-classpath.value" /> <java classname="${app}" classpath="${tests-classpath.value}"/> </target> <target name="testRunFail"> <java classname="${app}" classpath="${tests-classpath.value}" > <arg value="-1"/> </java> </target> <target name="testRunFailFoe"> <java classname="${app}" classpath="${tests-classpath.value}" failonerror="true"> <arg value="-1"/> </java> </target> <target name="testRunFailFoeFork"> <java classname="${app}" classpath="${tests-classpath.value}" failonerror="true" fork="true"> <arg value="-1"/> </java> </target> <target name="testExcepting"> <java classname="${app2}" classpath="${tests-classpath.value}" > </java> </target> <target name="testExceptingFork"> <java classname="${app2}" classpath="${tests-classpath.value}" fork="true"> </java> </target> <target name="testExceptingFoe"> <java classname="${app2}" classpath="${tests-classpath.value}" failonerror="true"> </java> </target> <target name="testExceptingFoeFork"> <java classname="${app2}" classpath="${tests-classpath.value}" failonerror="true" fork="true"> </java> </target> <target name="testResultPropertyZero"> <java classname="${app}" classpath="${tests-classpath.value}" resultproperty="exitcode" > </java> <echo message="exitcode = ${exitcode}"/> </target> <target name="testResultPropertyNonZero"> <java classname="${app}" classpath="${tests-classpath.value}" resultproperty="exitcode" failonerror="false" fork="true" > <arg value="-1"/> </java> <echo message="exitcode = ${exitcode}"/> </target> <target name="testSpawn"> <java classname="${spawnapp}" fork="true" spawn="true" classpath="${tests-classpath.value}"> <arg value="${timeToWait}"/> <arg value="${logFile}" /> </java> </target> <target name="cleanup"> <delete file="${logFile}"/> </target> <target name="foo" /> </project>