git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1585230 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -17,13 +17,20 @@ | |||||
| --> | --> | ||||
| <project name="java-test" basedir="." default="foo"> | <project name="java-test" basedir="." default="foo"> | ||||
| <property name="tests-classpath.value" value="${java.class.path}"/> | |||||
| <fail unless="tests-classpath.value" | <fail unless="tests-classpath.value" | ||||
| message="the property tests-classpath.value is required by this test" /> | message="the property tests-classpath.value is required by this test" /> | ||||
| <import file="../buildfiletest-base.xml"/> | |||||
| <target name="setUp"> | |||||
| <mkdir dir="${output}" /> | |||||
| </target> | |||||
| <!-- this property gets overridden programmatically--> | <!-- this property gets overridden programmatically--> | ||||
| <property name="timeToWait" value="4"/> | <property name="timeToWait" value="4"/> | ||||
| <!-- this property gets overridden programmatically--> | <!-- this property gets overridden programmatically--> | ||||
| <property name="logFile" value="spawn.log"/> | |||||
| <property name="tmp" location="${java.io.tmpdir}/ant.tmp.java-test"/> | |||||
| <property name="logFile" value="${output}/spawn.log"/> | |||||
| <property name="tmp" location="${output}/ant.tmp.java-test"/> | |||||
| <mkdir dir="${tmp}" description="The directory must exist"/> | <mkdir dir="${tmp}" description="The directory must exist"/> | ||||
| <property name="app" | <property name="app" | ||||
| value="org.apache.tools.ant.taskdefs.JavaTest$$EntryPoint" /> | value="org.apache.tools.ant.taskdefs.JavaTest$$EntryPoint" /> | ||||
| @@ -392,12 +399,6 @@ redirect.err="${redirect.err}" should be empty</fail> | |||||
| classpath="${tests-classpath.value}" failonerror="true" timeout="2000" /> | classpath="${tests-classpath.value}" failonerror="true" timeout="2000" /> | ||||
| </target> | </target> | ||||
| <target name="cleanup"> | |||||
| <delete failonerror="false"> | |||||
| <fileset file="${logFile}" /> | |||||
| </delete> | |||||
| </target> | |||||
| <target name="foo" /> | <target name="foo" /> | ||||
| </project> | </project> | ||||
| @@ -17,44 +17,42 @@ | |||||
| --> | --> | ||||
| <project name="manifestclasspath" default="tearDown"> | <project name="manifestclasspath" default="tearDown"> | ||||
| <!-- hebrew --> | |||||
| <property name="jom" value="םוי"/> | |||||
| <!-- german --> | |||||
| <property name="aent" value="ãnt"/> | |||||
| <import file="../buildfiletest-base.xml"/> | |||||
| <target name="setUp"> | <target name="setUp"> | ||||
| <property name="tmp" location="${basedir}/${ant.project.name}.tmp" /> | |||||
| <mkdir dir="${tmp}" /> | |||||
| <mkdir dir="${output}" /> | |||||
| </target> | </target> | ||||
| <!-- hebrew --> | |||||
| <property name="jom" value="םוי"/> | |||||
| <!-- german --> | |||||
| <property name="aent" value="ãnt"/> | |||||
| <target name="fullSetUp" depends="setUp"> | <target name="fullSetUp" depends="setUp"> | ||||
| <mkdir dir="${tmp}/lib" /> | |||||
| <touch file="${tmp}/lib/acme-core.jar" /> | |||||
| <touch file="${tmp}/lib/acme-pres.jar" /> | |||||
| <mkdir dir="${tmp}/classes/dsp-core/com/lgc/infra/core" /> | |||||
| <mkdir dir="${tmp}/classes/dsp-pres/com/lgc/infra/pres" /> | |||||
| <mkdir dir="${tmp}/classes/dsp-void" /> | |||||
| <mkdir dir="${tmp}/generated/dsp-core/com/lgc/infra/core/generated" /> | |||||
| <mkdir dir="${tmp}/generated/dsp-pres" /> | |||||
| <mkdir dir="${tmp}/generated/dsp-void" /> | |||||
| <mkdir dir="${tmp}/resources/dsp-core/com/lgc/infra/core" /> | |||||
| <mkdir dir="${tmp}/resources/dsp-pres/com/lgc/infra/pres" /> | |||||
| <mkdir dir="${tmp}/resources/dsp-void" /> | |||||
| </target> | |||||
| <mkdir dir="${output}/lib" /> | |||||
| <touch file="${output}/lib/acme-core.jar" /> | |||||
| <touch file="${output}/lib/acme-pres.jar" /> | |||||
| <target name="tearDown"> | |||||
| <delete dir="${tmp}" /> | |||||
| <mkdir dir="${output}/classes/dsp-core/com/lgc/infra/core" /> | |||||
| <mkdir dir="${output}/classes/dsp-pres/com/lgc/infra/pres" /> | |||||
| <mkdir dir="${output}/classes/dsp-void" /> | |||||
| <mkdir dir="${output}/generated/dsp-core/com/lgc/infra/core/generated" /> | |||||
| <mkdir dir="${output}/generated/dsp-pres" /> | |||||
| <mkdir dir="${output}/generated/dsp-void" /> | |||||
| <mkdir dir="${output}/resources/dsp-core/com/lgc/infra/core" /> | |||||
| <mkdir dir="${output}/resources/dsp-pres/com/lgc/infra/pres" /> | |||||
| <mkdir dir="${output}/resources/dsp-void" /> | |||||
| </target> | </target> | ||||
| <target name="test-bad-directory"> | <target name="test-bad-directory"> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classpath.jar"> | |||||
| jarfile="${output}/classpath.jar"> | |||||
| <classpath /> | <classpath /> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| <target name="test-bad-no-property" depends="setUp"> | <target name="test-bad-no-property" depends="setUp"> | ||||
| <manifestclasspath jarfile="${tmp}/classpath.jar"> | |||||
| <manifestclasspath jarfile="${output}/classpath.jar"> | |||||
| <classpath /> | <classpath /> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| @@ -62,7 +60,7 @@ | |||||
| <target name="test-bad-property-exists" depends="setUp"> | <target name="test-bad-property-exists" depends="setUp"> | ||||
| <property name="jar.classpath" value="exists" /> | <property name="jar.classpath" value="exists" /> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classpath.jar"> | |||||
| jarfile="${output}/classpath.jar"> | |||||
| <classpath /> | <classpath /> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| @@ -75,56 +73,56 @@ | |||||
| <target name="test-bad-no-classpath" depends="setUp"> | <target name="test-bad-no-classpath" depends="setUp"> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classpath.jar" /> | |||||
| jarfile="${output}/classpath.jar" /> | |||||
| </target> | </target> | ||||
| <target name="test-pseudo-tahoe-refid" depends="fullSetUp"> | <target name="test-pseudo-tahoe-refid" depends="fullSetUp"> | ||||
| <path id="classpath"> | <path id="classpath"> | ||||
| <!-- All the classes/ directories --> | <!-- All the classes/ directories --> | ||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <!-- All the JAXB generated/ directories --> | <!-- All the JAXB generated/ directories --> | ||||
| <dirset dir="${tmp}/generated" includes="dsp-*"> | |||||
| <dirset dir="${output}/generated" includes="dsp-*"> | |||||
| <!-- Add only non-empty directories to the classpath --> | <!-- Add only non-empty directories to the classpath --> | ||||
| <present targetdir="${tmp}/generated" present="both"> | |||||
| <present targetdir="${output}/generated" present="both"> | |||||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | <mapper type="regexp" from="(.*)" to="\1/com" /> | ||||
| </present> | </present> | ||||
| </dirset> | </dirset> | ||||
| <!-- All the resources/ directories --> | <!-- All the resources/ directories --> | ||||
| <dirset dir="${tmp}/resources" includes="dsp-*"> | |||||
| <dirset dir="${output}/resources" includes="dsp-*"> | |||||
| <!-- Add only non-empty directories to the classpath --> | <!-- Add only non-empty directories to the classpath --> | ||||
| <present targetdir="${tmp}/resources" present="both"> | |||||
| <present targetdir="${output}/resources" present="both"> | |||||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | <mapper type="regexp" from="(.*)" to="\1/com" /> | ||||
| </present> | </present> | ||||
| </dirset> | </dirset> | ||||
| </path> | </path> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classpath.jar"> | |||||
| jarfile="${output}/classpath.jar"> | |||||
| <classpath refid="classpath" /> | <classpath refid="classpath" /> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| <target name="test-pseudo-tahoe-nested" depends="fullSetUp"> | <target name="test-pseudo-tahoe-nested" depends="fullSetUp"> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classpath.jar"> | |||||
| jarfile="${output}/classpath.jar"> | |||||
| <classpath> | <classpath> | ||||
| <!-- All the classes/ directories --> | <!-- All the classes/ directories --> | ||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <!-- All the JAXB generated/ directories --> | <!-- All the JAXB generated/ directories --> | ||||
| <dirset dir="${tmp}/generated" includes="dsp-*"> | |||||
| <dirset dir="${output}/generated" includes="dsp-*"> | |||||
| <!-- Add only non-empty directories to the classpath --> | <!-- Add only non-empty directories to the classpath --> | ||||
| <present targetdir="${tmp}/generated" present="both"> | |||||
| <present targetdir="${output}/generated" present="both"> | |||||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | <mapper type="regexp" from="(.*)" to="\1/com" /> | ||||
| </present> | </present> | ||||
| </dirset> | </dirset> | ||||
| <!-- All the resources/ directories --> | <!-- All the resources/ directories --> | ||||
| <dirset dir="${tmp}/resources" includes="dsp-*"> | |||||
| <dirset dir="${output}/resources" includes="dsp-*"> | |||||
| <!-- Add only non-empty directories to the classpath --> | <!-- Add only non-empty directories to the classpath --> | ||||
| <present targetdir="${tmp}/resources" present="both"> | |||||
| <present targetdir="${output}/resources" present="both"> | |||||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | <mapper type="regexp" from="(.*)" to="\1/com" /> | ||||
| </present> | </present> | ||||
| </dirset> | </dirset> | ||||
| @@ -134,48 +132,48 @@ | |||||
| <target name="test-parent-level1" depends="fullSetUp"> | <target name="test-parent-level1" depends="fullSetUp"> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classes/classpath.jar"> | |||||
| jarfile="${output}/classes/classpath.jar"> | |||||
| <classpath> | <classpath> | ||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/resources" includes="dsp-*" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${output}/resources" includes="dsp-*" /> | |||||
| </classpath> | </classpath> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| <target name="test-parent-level2" depends="fullSetUp"> | <target name="test-parent-level2" depends="fullSetUp"> | ||||
| <mkdir dir="${tmp}/classes/level2" /> | |||||
| <mkdir dir="${output}/classes/level2" /> | |||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||||
| jarfile="${output}/classes/level2/classpath.jar"> | |||||
| <classpath> | <classpath> | ||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/resources" includes="dsp-*" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${output}/resources" includes="dsp-*" /> | |||||
| </classpath> | </classpath> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| <target name="test-parent-level2-too-deep" depends="fullSetUp"> | <target name="test-parent-level2-too-deep" depends="fullSetUp"> | ||||
| <mkdir dir="${tmp}/classes/level2" /> | |||||
| <mkdir dir="${output}/classes/level2" /> | |||||
| <manifestclasspath property="jar.classpath" maxParentLevels="1" | <manifestclasspath property="jar.classpath" maxParentLevels="1" | ||||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||||
| jarfile="${output}/classes/level2/classpath.jar"> | |||||
| <classpath> | <classpath> | ||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/resources" includes="dsp-*" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${output}/resources" includes="dsp-*" /> | |||||
| </classpath> | </classpath> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| <target name="test-parent-level2-with-jars" depends="fullSetUp"> | <target name="test-parent-level2-with-jars" depends="fullSetUp"> | ||||
| <mkdir dir="${tmp}/classes/level2" /> | |||||
| <mkdir dir="${output}/classes/level2" /> | |||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||||
| jarfile="${output}/classes/level2/classpath.jar"> | |||||
| <classpath> | <classpath> | ||||
| <fileset dir="${tmp}/lib" includes="*.jar" /> | |||||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${tmp}/resources" includes="dsp-*" /> | |||||
| <fileset dir="${output}/lib" includes="*.jar" /> | |||||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||||
| <dirset dir="${output}/generated" includes="dsp-*" /> | |||||
| <dirset dir="${output}/resources" includes="dsp-*" /> | |||||
| </classpath> | </classpath> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| </target> | </target> | ||||
| @@ -191,22 +189,22 @@ | |||||
| </antcall> | </antcall> | ||||
| </target> | </target> | ||||
| <target name="run-two-jars"> | <target name="run-two-jars"> | ||||
| <mkdir dir="${tmp}/${ext.dir}"/> | |||||
| <javac srcdir="manifestclasspath" destdir="${tmp}" /> | |||||
| <jar destfile="${tmp}/${ext.dir}/alpha.jar"> | |||||
| <fileset dir="${tmp}"> | |||||
| <mkdir dir="${output}/${ext.dir}"/> | |||||
| <javac srcdir="manifestclasspath" destdir="${output}" /> | |||||
| <jar destfile="${output}/${ext.dir}/alpha.jar"> | |||||
| <fileset dir="${output}"> | |||||
| <include name="Alpha.class"/> | <include name="Alpha.class"/> | ||||
| </fileset> | </fileset> | ||||
| </jar> | </jar> | ||||
| <manifestclasspath property="jar.classpath" | <manifestclasspath property="jar.classpath" | ||||
| jarfile="${tmp}/beta.jar"> | |||||
| jarfile="${output}/beta.jar"> | |||||
| <classpath> | <classpath> | ||||
| <pathelement location="${tmp}/beta.jar"/> | |||||
| <pathelement location="${tmp}/${ext.dir}/alpha.jar"/> | |||||
| <pathelement location="${output}/beta.jar"/> | |||||
| <pathelement location="${output}/${ext.dir}/alpha.jar"/> | |||||
| </classpath> | </classpath> | ||||
| </manifestclasspath> | </manifestclasspath> | ||||
| <jar destfile="${tmp}/beta.jar" > | |||||
| <fileset dir="${tmp}"> | |||||
| <jar destfile="${output}/beta.jar" > | |||||
| <fileset dir="${output}"> | |||||
| <include name="Beta.class"/> | <include name="Beta.class"/> | ||||
| </fileset> | </fileset> | ||||
| <manifest> | <manifest> | ||||
| @@ -214,7 +212,7 @@ | |||||
| <attribute name="Class-Path" value="${jar.classpath}"/> | <attribute name="Class-Path" value="${jar.classpath}"/> | ||||
| </manifest> | </manifest> | ||||
| </jar> | </jar> | ||||
| <java fork="true" jar="${tmp}/beta.jar"/> | |||||
| <java fork="true" jar="${output}/beta.jar"/> | |||||
| </target> | </target> | ||||
| <target name="testSameDrive"> | <target name="testSameDrive"> | ||||
| @@ -18,6 +18,12 @@ | |||||
| <project name="xxx-test" basedir="." default="test1"> | <project name="xxx-test" basedir="." default="test1"> | ||||
| <import file="../buildfiletest-base.xml"/> | |||||
| <target name="setUp"> | |||||
| <mkdir dir="${output}" /> | |||||
| </target> | |||||
| <target name="test1"> | <target name="test1"> | ||||
| <mkdir/> | <mkdir/> | ||||
| </target> | </target> | ||||
| @@ -27,7 +33,7 @@ | |||||
| </target> | </target> | ||||
| <target name="test3"> | <target name="test3"> | ||||
| <mkdir dir="testdir.tmp"/> | |||||
| <mkdir dir="${output}/testdir.tmp"/> | |||||
| </target> | </target> | ||||
| </project> | </project> | ||||
| @@ -18,9 +18,15 @@ | |||||
| <project name="move-test" basedir="." default="testFilterSet"> | <project name="move-test" basedir="." default="testFilterSet"> | ||||
| <import file="../buildfiletest-base.xml"/> | |||||
| <target name="setUp"> | |||||
| <mkdir dir="${output}" /> | |||||
| </target> | |||||
| <target name="testFilterSet"> | <target name="testFilterSet"> | ||||
| <copy file="copy.filterset" tofile="move.filterset"/> | |||||
| <move file="move.filterset" tofile="move.filterset.tmp"> | |||||
| <copy file="copy.filterset" tofile="${output}/move.filterset"/> | |||||
| <move file="${output}/move.filterset" tofile="${output}/move.filterset.tmp"> | |||||
| <filterset> | <filterset> | ||||
| <filter token="TITLE" value="Apache Ant Project"/> | <filter token="TITLE" value="Apache Ant Project"/> | ||||
| </filterset> | </filterset> | ||||
| @@ -28,8 +34,8 @@ | |||||
| </target> | </target> | ||||
| <target name="testFilterChain"> | <target name="testFilterChain"> | ||||
| <copy file="copy.filterset" tofile="move.filterchain"/> | |||||
| <move file="move.filterchain" tofile="move.filterchain.tmp"> | |||||
| <copy file="copy.filterset" tofile="${output}/move.filterchain"/> | |||||
| <move file="${output}/move.filterchain" tofile="${output}/move.filterchain.tmp"> | |||||
| <filterchain> | <filterchain> | ||||
| <replacetokens> | <replacetokens> | ||||
| <token key="TITLE" value="Apache Ant Project"/> | <token key="TITLE" value="Apache Ant Project"/> | ||||
| @@ -40,15 +46,15 @@ | |||||
| <!-- Bugzilla Report 11732 --> | <!-- Bugzilla Report 11732 --> | ||||
| <target name="testDirectoryRemoval"> | <target name="testDirectoryRemoval"> | ||||
| <mkdir dir="A/B"/> | |||||
| <mkdir dir="A/C"/> | |||||
| <mkdir dir="A/D"/> | |||||
| <touch file="A/B/1"/> | |||||
| <touch file="A/C/2"/> | |||||
| <touch file="A/D/3"/> | |||||
| <mkdir dir="E"/> | |||||
| <move todir="E" includeemptydirs="true"> | |||||
| <fileset dir="A"> | |||||
| <mkdir dir="${output}/A/B"/> | |||||
| <mkdir dir="${output}/A/C"/> | |||||
| <mkdir dir="${output}/A/D"/> | |||||
| <touch file="${output}/A/B/1"/> | |||||
| <touch file="${output}/A/C/2"/> | |||||
| <touch file="${output}/A/D/3"/> | |||||
| <mkdir dir="${output}/E"/> | |||||
| <move todir="${output}/E" includeemptydirs="true"> | |||||
| <fileset dir="${output}/A"> | |||||
| <include name="C"/> | <include name="C"/> | ||||
| <include name="D"/> | <include name="D"/> | ||||
| <include name="C/**"/> | <include name="C/**"/> | ||||
| @@ -59,83 +65,83 @@ | |||||
| <!-- Bugzilla Report 18886 --> | <!-- Bugzilla Report 18886 --> | ||||
| <target name="testDirectoryRetaining"> | <target name="testDirectoryRetaining"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <mkdir dir="E"/> | |||||
| <move todir="E" includeemptydirs="true"> | |||||
| <fileset dir="A" includes="1"/> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <mkdir dir="${output}/E"/> | |||||
| <move todir="${output}/E" includeemptydirs="true"> | |||||
| <fileset dir="${output}/A" includes="1"/> | |||||
| </move> | </move> | ||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMove"> | <target name="testCompleteDirectoryMove"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <move todir="E"> | |||||
| <fileset dir="A"/> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <move todir="${output}/E"> | |||||
| <fileset dir="${output}/A"/> | |||||
| </move> | </move> | ||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMove2"> | <target name="testCompleteDirectoryMove2"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <move todir="E"> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <move todir="${output}/E"> | |||||
| <path> | <path> | ||||
| <fileset dir="A"/> | |||||
| <fileset dir="${output}/A"/> | |||||
| </path> | </path> | ||||
| </move> | </move> | ||||
| </target> | </target> | ||||
| <target name="testPathElementMove"> | <target name="testPathElementMove"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <move todir="E" flatten="true"> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <move todir="${output}/E" flatten="true"> | |||||
| <path> | <path> | ||||
| <pathelement location="A/1"/> | |||||
| <pathelement location="${output}/A/1"/> | |||||
| </path> | </path> | ||||
| </move> | </move> | ||||
| </target> | </target> | ||||
| <target name="testMoveFileAndFileset"> | <target name="testMoveFileAndFileset"> | ||||
| <mkdir dir="A" /> | |||||
| <mkdir dir="${output}/A" /> | |||||
| <touch> | <touch> | ||||
| <filelist dir="A" files="1,2,3" /> | |||||
| <filelist dir="${output}/A" files="1,2,3" /> | |||||
| </touch> | </touch> | ||||
| <move todir="E" file="A/1"> | |||||
| <fileset dir="A" includes="2,3" /> | |||||
| <move todir="${output}/E" file="${output}/A/1"> | |||||
| <fileset dir="${output}/A" includes="2,3" /> | |||||
| </move> | </move> | ||||
| <fail message="A unavailable"> | <fail message="A unavailable"> | ||||
| <condition> | <condition> | ||||
| <not> | <not> | ||||
| <available file="A" type="dir" /> | |||||
| <available file="${output}/A" type="dir" /> | |||||
| </not> | </not> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| <fail message="A/1 not moved"> | |||||
| <fail message="${output}/A/1 not moved"> | |||||
| <condition> | <condition> | ||||
| <or> | <or> | ||||
| <available file="A/1" type="file" /> | |||||
| <available file="${output}/A/1" type="file" /> | |||||
| <not> | <not> | ||||
| <available file="E/1" type="file" /> | |||||
| <available file="${output}/E/1" type="file" /> | |||||
| </not> | </not> | ||||
| </or> | </or> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| <fail message="A/2 not moved"> | |||||
| <fail message="${output}/A/2 not moved"> | |||||
| <condition> | <condition> | ||||
| <or> | <or> | ||||
| <available file="A/2" type="file" /> | |||||
| <available file="${output}/A/2" type="file" /> | |||||
| <not> | <not> | ||||
| <available file="E/2" type="file" /> | |||||
| <available file="${output}/E/2" type="file" /> | |||||
| </not> | </not> | ||||
| </or> | </or> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| <fail message="A/3 not moved"> | |||||
| <fail message="${output}/A/3 not moved"> | |||||
| <condition> | <condition> | ||||
| <or> | <or> | ||||
| <available file="A/3" type="file" /> | |||||
| <available file="${output}/A/3" type="file" /> | |||||
| <not> | <not> | ||||
| <available file="E/3" type="file" /> | |||||
| <available file="${output}/E/3" type="file" /> | |||||
| </not> | </not> | ||||
| </or> | </or> | ||||
| </condition> | </condition> | ||||
| @@ -162,104 +168,96 @@ | |||||
| </macrodef> | </macrodef> | ||||
| <target name="testCompleteDirectoryMoveToExistingDir"> | <target name="testCompleteDirectoryMoveToExistingDir"> | ||||
| <mkdir dir="A" /> | |||||
| <touch file="A/1" /> | |||||
| <mkdir dir="E" /> | |||||
| <touch file="E/2" /> | |||||
| <move todir="E"> | |||||
| <fileset dir="A" /> | |||||
| <mkdir dir="${output}/A" /> | |||||
| <touch file="${output}/A/1" /> | |||||
| <mkdir dir="${output}/E" /> | |||||
| <touch file="${output}/E/2" /> | |||||
| <move todir="${output}/E"> | |||||
| <fileset dir="${output}/A" /> | |||||
| </move> | </move> | ||||
| <verifymove newfile="E/1" olddir="A" /> | |||||
| <verifymove newfile="${output}/E/1" olddir="${output}/A" /> | |||||
| <fail message="E/2 unavailable"> | <fail message="E/2 unavailable"> | ||||
| <condition> | <condition> | ||||
| <not> | <not> | ||||
| <available file="E/2" type="file" /> | |||||
| <available file="${output}/E/2" type="file" /> | |||||
| </not> | </not> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToFile"> | <target name="testCompleteDirectoryMoveFileToFile"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <move file="A" tofile="E" /> | |||||
| <verifymove newfile="E/1" olddir="A" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <move file="${output}/A" tofile="${output}/E" /> | |||||
| <verifymove newfile="${output}/E/1" olddir="${output}/A" /> | |||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToDir"> | <target name="testCompleteDirectoryMoveFileToDir"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <move file="A" todir="E" /> | |||||
| <verifymove newfile="E/A/1" olddir="A" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <move file="${output}/A" todir="${output}/E" /> | |||||
| <verifymove newfile="${output}/E/A/1" olddir="${output}/A" /> | |||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileAndFileset"> | <target name="testCompleteDirectoryMoveFileAndFileset"> | ||||
| <mkdir dir="A/1" /> | |||||
| <touch file="A/2" /> | |||||
| <move file="A/1" todir="E"> | |||||
| <fileset dir="A" includes="2" /> | |||||
| <mkdir dir="${output}/A/1" /> | |||||
| <touch file="${output}/A/2" /> | |||||
| <move file="${output}/A/1" todir="${output}/E"> | |||||
| <fileset dir="${output}/A" includes="2" /> | |||||
| </move> | </move> | ||||
| <fail message="A unavailable"> | <fail message="A unavailable"> | ||||
| <condition> | <condition> | ||||
| <not> | <not> | ||||
| <available file="A" type="dir" /> | |||||
| <available file="${output}/A" type="dir" /> | |||||
| </not> | </not> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| <fail message="E/1 unavailable"> | <fail message="E/1 unavailable"> | ||||
| <condition> | <condition> | ||||
| <not> | <not> | ||||
| <available file="E/1" type="dir" /> | |||||
| <available file="${output}/E/1" type="dir" /> | |||||
| </not> | </not> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| <fail message="E/2 unavailable"> | <fail message="E/2 unavailable"> | ||||
| <condition> | <condition> | ||||
| <not> | <not> | ||||
| <available file="E/2" type="file" /> | |||||
| <available file="${output}/E/2" type="file" /> | |||||
| </not> | </not> | ||||
| </condition> | </condition> | ||||
| </fail> | </fail> | ||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToExistingFile"> | <target name="testCompleteDirectoryMoveFileToExistingFile"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <touch file="E"/> | |||||
| <move file="A" tofile="E" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <touch file="${output}/E"/> | |||||
| <move file="${output}/A" tofile="${output}/E" /> | |||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToExistingDir"> | <target name="testCompleteDirectoryMoveFileToExistingDir"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <mkdir dir="E"/> | |||||
| <move file="A" tofile="E" /> | |||||
| <verifymove newfile="E/1" olddir="A" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <mkdir dir="${output}/E"/> | |||||
| <move file="${output}/A" tofile="${output}/E" /> | |||||
| <verifymove newfile="${output}/E/1" olddir="${output}/A" /> | |||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToDirWithExistingFile"> | <target name="testCompleteDirectoryMoveFileToDirWithExistingFile"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <mkdir dir="E"/> | |||||
| <touch file="E/A"/> | |||||
| <move file="A" todir="E" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <mkdir dir="${output}/E"/> | |||||
| <touch file="${output}/E/A"/> | |||||
| <move file="${output}/A" todir="${output}/E" /> | |||||
| </target> | </target> | ||||
| <target name="testCompleteDirectoryMoveFileToDirWithExistingDir"> | <target name="testCompleteDirectoryMoveFileToDirWithExistingDir"> | ||||
| <mkdir dir="A"/> | |||||
| <touch file="A/1"/> | |||||
| <mkdir dir="E"/> | |||||
| <mkdir dir="E/A"/> | |||||
| <move file="A" todir="E" /> | |||||
| <verifymove newfile="E/A/1" olddir="A" /> | |||||
| </target> | |||||
| <target name="cleanup"> | |||||
| <delete file="move.filterset.tmp"/> | |||||
| <delete file="move.filterchain.tmp"/> | |||||
| <delete dir="A" /> | |||||
| <delete file="B" /> | |||||
| <delete dir="E" /> | |||||
| <mkdir dir="${output}/A"/> | |||||
| <touch file="${output}/A/1"/> | |||||
| <mkdir dir="${output}/E"/> | |||||
| <mkdir dir="${output}/E/A"/> | |||||
| <move file="${output}/A" todir="${output}/E" /> | |||||
| <verifymove newfile="${output}/E/A/1" olddir="${output}/A" /> | |||||
| </target> | </target> | ||||
| </project> | </project> | ||||
| @@ -60,6 +60,7 @@ public class JavaTest extends BuildFileTest { | |||||
| */ | */ | ||||
| public void setUp() { | public void setUp() { | ||||
| configureProject("src/etc/testcases/taskdefs/java.xml"); | configureProject("src/etc/testcases/taskdefs/java.xml"); | ||||
| project.executeTarget("setUp"); | |||||
| //final String propname="tests-classpath.value"; | //final String propname="tests-classpath.value"; | ||||
| //String testClasspath=System.getProperty(propname); | //String testClasspath=System.getProperty(propname); | ||||
| @@ -69,11 +70,6 @@ public class JavaTest extends BuildFileTest { | |||||
| runFatalTests=true; | runFatalTests=true; | ||||
| } | } | ||||
| public void tearDown() { | |||||
| // remove log file from testSpawn | |||||
| project.executeTarget("cleanup"); | |||||
| } | |||||
| public void testNoJarNoClassname(){ | public void testNoJarNoClassname(){ | ||||
| expectBuildExceptionContaining("testNoJarNoClassname", | expectBuildExceptionContaining("testNoJarNoClassname", | ||||
| "parameter validation", | "parameter validation", | ||||
| @@ -180,7 +176,7 @@ public class JavaTest extends BuildFileTest { | |||||
| } | } | ||||
| public void testSpawn() { | public void testSpawn() { | ||||
| File logFile = FILE_UTILS.createTempFile("spawn","log", project.getBaseDir(), false, false); | |||||
| File logFile = FILE_UTILS.createTempFile("spawn","log", getOutputDir(), false, false); | |||||
| // this is guaranteed by FileUtils#createTempFile | // this is guaranteed by FileUtils#createTempFile | ||||
| assertTrue("log file not existing", !logFile.exists()); | assertTrue("log file not existing", !logFile.exists()); | ||||
| project.setProperty("logFile", logFile.getAbsolutePath()); | project.setProperty("logFile", logFile.getAbsolutePath()); | ||||
| @@ -41,7 +41,7 @@ public class MkdirTest extends BuildFileTest { | |||||
| public void test3() { | public void test3() { | ||||
| executeTarget("test3"); | executeTarget("test3"); | ||||
| java.io.File f = new java.io.File(getProjectDir(), "testdir.tmp"); | |||||
| java.io.File f = new java.io.File(getOutputDir(), "testdir.tmp"); | |||||
| if (!f.exists() || !f.isDirectory()) { | if (!f.exists() || !f.isDirectory()) { | ||||
| fail("mkdir failed"); | fail("mkdir failed"); | ||||
| } else { | } else { | ||||
| @@ -38,15 +38,12 @@ public class MoveTest extends BuildFileTest { | |||||
| public void setUp() { | public void setUp() { | ||||
| configureProject("src/etc/testcases/taskdefs/move.xml"); | configureProject("src/etc/testcases/taskdefs/move.xml"); | ||||
| } | |||||
| public void tearDown() { | |||||
| executeTarget("cleanup"); | |||||
| project.executeTarget("setUp"); | |||||
| } | } | ||||
| public void testFilterSet() throws IOException { | public void testFilterSet() throws IOException { | ||||
| executeTarget("testFilterSet"); | executeTarget("testFilterSet"); | ||||
| File tmp = new File(getProjectDir(), "move.filterset.tmp"); | |||||
| File tmp = new File(getOutputDir(), "move.filterset.tmp"); | |||||
| File check = new File(getProjectDir(), "expected/copy.filterset.filtered"); | File check = new File(getProjectDir(), "expected/copy.filterset.filtered"); | ||||
| assertTrue(tmp.exists()); | assertTrue(tmp.exists()); | ||||
| assertTrue(FILE_UTILS.contentEquals(tmp, check)); | assertTrue(FILE_UTILS.contentEquals(tmp, check)); | ||||
| @@ -54,7 +51,7 @@ public class MoveTest extends BuildFileTest { | |||||
| public void testFilterChain() throws IOException { | public void testFilterChain() throws IOException { | ||||
| executeTarget("testFilterChain"); | executeTarget("testFilterChain"); | ||||
| File tmp = new File(getProjectDir(), "move.filterchain.tmp"); | |||||
| File tmp = new File(getOutputDir(), "move.filterchain.tmp"); | |||||
| File check = new File(getProjectDir(), "expected/copy.filterset.filtered"); | File check = new File(getProjectDir(), "expected/copy.filterset.filtered"); | ||||
| assertTrue(tmp.exists()); | assertTrue(tmp.exists()); | ||||
| assertTrue(FILE_UTILS.contentEquals(tmp, check)); | assertTrue(FILE_UTILS.contentEquals(tmp, check)); | ||||
| @@ -63,23 +60,23 @@ public class MoveTest extends BuildFileTest { | |||||
| /** Bugzilla Report 11732 */ | /** Bugzilla Report 11732 */ | ||||
| public void testDirectoryRemoval() throws IOException { | public void testDirectoryRemoval() throws IOException { | ||||
| executeTarget("testDirectoryRemoval"); | executeTarget("testDirectoryRemoval"); | ||||
| assertTrue(!getProject().resolveFile("E/B/1").exists()); | |||||
| assertTrue(getProject().resolveFile("E/C/2").exists()); | |||||
| assertTrue(getProject().resolveFile("E/D/3").exists()); | |||||
| assertTrue(getProject().resolveFile("A/B/1").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/C/2").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/D/3").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/C").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/D").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"E/B/1").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E/C/2").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E/D/3").exists()); | |||||
| assertTrue(new File(getOutputDir(),"A/B/1").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/C/2").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/D/3").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/C").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/D").exists()); | |||||
| } | } | ||||
| /** Bugzilla Report 18886 */ | /** Bugzilla Report 18886 */ | ||||
| public void testDirectoryRetaining() throws IOException { | public void testDirectoryRetaining() throws IOException { | ||||
| executeTarget("testDirectoryRetaining"); | executeTarget("testDirectoryRetaining"); | ||||
| assertTrue(getProject().resolveFile("E").exists()); | |||||
| assertTrue(getProject().resolveFile("E/1").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/1").exists()); | |||||
| assertTrue(getProject().resolveFile("A").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E/1").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/1").exists()); | |||||
| assertTrue(new File(getOutputDir(),"A").exists()); | |||||
| } | } | ||||
| public void testCompleteDirectoryMove() throws IOException { | public void testCompleteDirectoryMove() throws IOException { | ||||
| @@ -92,19 +89,19 @@ public class MoveTest extends BuildFileTest { | |||||
| private void testCompleteDirectoryMove(String target) throws IOException { | private void testCompleteDirectoryMove(String target) throws IOException { | ||||
| executeTarget(target); | executeTarget(target); | ||||
| assertTrue(getProject().resolveFile("E").exists()); | |||||
| assertTrue(getProject().resolveFile("E/1").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/1").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E/1").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/1").exists()); | |||||
| // <path> swallows the basedir, it seems | // <path> swallows the basedir, it seems | ||||
| //assertTrue(!getProject().resolveFile("A").exists()); | |||||
| //assertTrue(!new File(getOutputDir(),"A").exists()); | |||||
| } | } | ||||
| public void testPathElementMove() throws IOException { | public void testPathElementMove() throws IOException { | ||||
| executeTarget("testPathElementMove"); | executeTarget("testPathElementMove"); | ||||
| assertTrue(getProject().resolveFile("E").exists()); | |||||
| assertTrue(getProject().resolveFile("E/1").exists()); | |||||
| assertTrue(!getProject().resolveFile("A/1").exists()); | |||||
| assertTrue(getProject().resolveFile("A").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E").exists()); | |||||
| assertTrue(new File(getOutputDir(),"E/1").exists()); | |||||
| assertTrue(!new File(getOutputDir(),"A/1").exists()); | |||||
| assertTrue(new File(getOutputDir(),"A").exists()); | |||||
| } | } | ||||
| public void testMoveFileAndFileset() { | public void testMoveFileAndFileset() { | ||||