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"> | |||
| <property name="tests-classpath.value" value="${java.class.path}"/> | |||
| <fail unless="tests-classpath.value" | |||
| 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--> | |||
| <property name="timeToWait" value="4"/> | |||
| <!-- 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"/> | |||
| <property name="app" | |||
| 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" /> | |||
| </target> | |||
| <target name="cleanup"> | |||
| <delete failonerror="false"> | |||
| <fileset file="${logFile}" /> | |||
| </delete> | |||
| </target> | |||
| <target name="foo" /> | |||
| </project> | |||
| @@ -17,44 +17,42 @@ | |||
| --> | |||
| <project name="manifestclasspath" default="tearDown"> | |||
| <!-- hebrew --> | |||
| <property name="jom" value="םוי"/> | |||
| <!-- german --> | |||
| <property name="aent" value="ãnt"/> | |||
| <import file="../buildfiletest-base.xml"/> | |||
| <target name="setUp"> | |||
| <property name="tmp" location="${basedir}/${ant.project.name}.tmp" /> | |||
| <mkdir dir="${tmp}" /> | |||
| <mkdir dir="${output}" /> | |||
| </target> | |||
| <!-- hebrew --> | |||
| <property name="jom" value="םוי"/> | |||
| <!-- german --> | |||
| <property name="aent" value="ãnt"/> | |||
| <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 name="test-bad-directory"> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classpath.jar"> | |||
| jarfile="${output}/classpath.jar"> | |||
| <classpath /> | |||
| </manifestclasspath> | |||
| </target> | |||
| <target name="test-bad-no-property" depends="setUp"> | |||
| <manifestclasspath jarfile="${tmp}/classpath.jar"> | |||
| <manifestclasspath jarfile="${output}/classpath.jar"> | |||
| <classpath /> | |||
| </manifestclasspath> | |||
| </target> | |||
| @@ -62,7 +60,7 @@ | |||
| <target name="test-bad-property-exists" depends="setUp"> | |||
| <property name="jar.classpath" value="exists" /> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classpath.jar"> | |||
| jarfile="${output}/classpath.jar"> | |||
| <classpath /> | |||
| </manifestclasspath> | |||
| </target> | |||
| @@ -75,56 +73,56 @@ | |||
| <target name="test-bad-no-classpath" depends="setUp"> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classpath.jar" /> | |||
| jarfile="${output}/classpath.jar" /> | |||
| </target> | |||
| <target name="test-pseudo-tahoe-refid" depends="fullSetUp"> | |||
| <path id="classpath"> | |||
| <!-- All the classes/ directories --> | |||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||
| <!-- 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 --> | |||
| <present targetdir="${tmp}/generated" present="both"> | |||
| <present targetdir="${output}/generated" present="both"> | |||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | |||
| </present> | |||
| </dirset> | |||
| <!-- All the resources/ directories --> | |||
| <dirset dir="${tmp}/resources" includes="dsp-*"> | |||
| <dirset dir="${output}/resources" includes="dsp-*"> | |||
| <!-- 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" /> | |||
| </present> | |||
| </dirset> | |||
| </path> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classpath.jar"> | |||
| jarfile="${output}/classpath.jar"> | |||
| <classpath refid="classpath" /> | |||
| </manifestclasspath> | |||
| </target> | |||
| <target name="test-pseudo-tahoe-nested" depends="fullSetUp"> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classpath.jar"> | |||
| jarfile="${output}/classpath.jar"> | |||
| <classpath> | |||
| <!-- All the classes/ directories --> | |||
| <dirset dir="${tmp}/classes" includes="dsp-*" /> | |||
| <dirset dir="${output}/classes" includes="dsp-*" /> | |||
| <!-- 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 --> | |||
| <present targetdir="${tmp}/generated" present="both"> | |||
| <present targetdir="${output}/generated" present="both"> | |||
| <mapper type="regexp" from="(.*)" to="\1/com" /> | |||
| </present> | |||
| </dirset> | |||
| <!-- All the resources/ directories --> | |||
| <dirset dir="${tmp}/resources" includes="dsp-*"> | |||
| <dirset dir="${output}/resources" includes="dsp-*"> | |||
| <!-- 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" /> | |||
| </present> | |||
| </dirset> | |||
| @@ -134,48 +132,48 @@ | |||
| <target name="test-parent-level1" depends="fullSetUp"> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classes/classpath.jar"> | |||
| jarfile="${output}/classes/classpath.jar"> | |||
| <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> | |||
| </manifestclasspath> | |||
| </target> | |||
| <target name="test-parent-level2" depends="fullSetUp"> | |||
| <mkdir dir="${tmp}/classes/level2" /> | |||
| <mkdir dir="${output}/classes/level2" /> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||
| jarfile="${output}/classes/level2/classpath.jar"> | |||
| <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> | |||
| </manifestclasspath> | |||
| </target> | |||
| <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" | |||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||
| jarfile="${output}/classes/level2/classpath.jar"> | |||
| <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> | |||
| </manifestclasspath> | |||
| </target> | |||
| <target name="test-parent-level2-with-jars" depends="fullSetUp"> | |||
| <mkdir dir="${tmp}/classes/level2" /> | |||
| <mkdir dir="${output}/classes/level2" /> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/classes/level2/classpath.jar"> | |||
| jarfile="${output}/classes/level2/classpath.jar"> | |||
| <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> | |||
| </manifestclasspath> | |||
| </target> | |||
| @@ -191,22 +189,22 @@ | |||
| </antcall> | |||
| </target> | |||
| <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"/> | |||
| </fileset> | |||
| </jar> | |||
| <manifestclasspath property="jar.classpath" | |||
| jarfile="${tmp}/beta.jar"> | |||
| jarfile="${output}/beta.jar"> | |||
| <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> | |||
| </manifestclasspath> | |||
| <jar destfile="${tmp}/beta.jar" > | |||
| <fileset dir="${tmp}"> | |||
| <jar destfile="${output}/beta.jar" > | |||
| <fileset dir="${output}"> | |||
| <include name="Beta.class"/> | |||
| </fileset> | |||
| <manifest> | |||
| @@ -214,7 +212,7 @@ | |||
| <attribute name="Class-Path" value="${jar.classpath}"/> | |||
| </manifest> | |||
| </jar> | |||
| <java fork="true" jar="${tmp}/beta.jar"/> | |||
| <java fork="true" jar="${output}/beta.jar"/> | |||
| </target> | |||
| <target name="testSameDrive"> | |||
| @@ -18,6 +18,12 @@ | |||
| <project name="xxx-test" basedir="." default="test1"> | |||
| <import file="../buildfiletest-base.xml"/> | |||
| <target name="setUp"> | |||
| <mkdir dir="${output}" /> | |||
| </target> | |||
| <target name="test1"> | |||
| <mkdir/> | |||
| </target> | |||
| @@ -27,7 +33,7 @@ | |||
| </target> | |||
| <target name="test3"> | |||
| <mkdir dir="testdir.tmp"/> | |||
| <mkdir dir="${output}/testdir.tmp"/> | |||
| </target> | |||
| </project> | |||
| @@ -18,9 +18,15 @@ | |||
| <project name="move-test" basedir="." default="testFilterSet"> | |||
| <import file="../buildfiletest-base.xml"/> | |||
| <target name="setUp"> | |||
| <mkdir dir="${output}" /> | |||
| </target> | |||
| <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> | |||
| <filter token="TITLE" value="Apache Ant Project"/> | |||
| </filterset> | |||
| @@ -28,8 +34,8 @@ | |||
| </target> | |||
| <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> | |||
| <replacetokens> | |||
| <token key="TITLE" value="Apache Ant Project"/> | |||
| @@ -40,15 +46,15 @@ | |||
| <!-- Bugzilla Report 11732 --> | |||
| <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="D"/> | |||
| <include name="C/**"/> | |||
| @@ -59,83 +65,83 @@ | |||
| <!-- Bugzilla Report 18886 --> | |||
| <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> | |||
| </target> | |||
| <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> | |||
| </target> | |||
| <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> | |||
| <fileset dir="A"/> | |||
| <fileset dir="${output}/A"/> | |||
| </path> | |||
| </move> | |||
| </target> | |||
| <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> | |||
| <pathelement location="A/1"/> | |||
| <pathelement location="${output}/A/1"/> | |||
| </path> | |||
| </move> | |||
| </target> | |||
| <target name="testMoveFileAndFileset"> | |||
| <mkdir dir="A" /> | |||
| <mkdir dir="${output}/A" /> | |||
| <touch> | |||
| <filelist dir="A" files="1,2,3" /> | |||
| <filelist dir="${output}/A" files="1,2,3" /> | |||
| </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> | |||
| <fail message="A unavailable"> | |||
| <condition> | |||
| <not> | |||
| <available file="A" type="dir" /> | |||
| <available file="${output}/A" type="dir" /> | |||
| </not> | |||
| </condition> | |||
| </fail> | |||
| <fail message="A/1 not moved"> | |||
| <fail message="${output}/A/1 not moved"> | |||
| <condition> | |||
| <or> | |||
| <available file="A/1" type="file" /> | |||
| <available file="${output}/A/1" type="file" /> | |||
| <not> | |||
| <available file="E/1" type="file" /> | |||
| <available file="${output}/E/1" type="file" /> | |||
| </not> | |||
| </or> | |||
| </condition> | |||
| </fail> | |||
| <fail message="A/2 not moved"> | |||
| <fail message="${output}/A/2 not moved"> | |||
| <condition> | |||
| <or> | |||
| <available file="A/2" type="file" /> | |||
| <available file="${output}/A/2" type="file" /> | |||
| <not> | |||
| <available file="E/2" type="file" /> | |||
| <available file="${output}/E/2" type="file" /> | |||
| </not> | |||
| </or> | |||
| </condition> | |||
| </fail> | |||
| <fail message="A/3 not moved"> | |||
| <fail message="${output}/A/3 not moved"> | |||
| <condition> | |||
| <or> | |||
| <available file="A/3" type="file" /> | |||
| <available file="${output}/A/3" type="file" /> | |||
| <not> | |||
| <available file="E/3" type="file" /> | |||
| <available file="${output}/E/3" type="file" /> | |||
| </not> | |||
| </or> | |||
| </condition> | |||
| @@ -162,104 +168,96 @@ | |||
| </macrodef> | |||
| <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> | |||
| <verifymove newfile="E/1" olddir="A" /> | |||
| <verifymove newfile="${output}/E/1" olddir="${output}/A" /> | |||
| <fail message="E/2 unavailable"> | |||
| <condition> | |||
| <not> | |||
| <available file="E/2" type="file" /> | |||
| <available file="${output}/E/2" type="file" /> | |||
| </not> | |||
| </condition> | |||
| </fail> | |||
| </target> | |||
| <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 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 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> | |||
| <fail message="A unavailable"> | |||
| <condition> | |||
| <not> | |||
| <available file="A" type="dir" /> | |||
| <available file="${output}/A" type="dir" /> | |||
| </not> | |||
| </condition> | |||
| </fail> | |||
| <fail message="E/1 unavailable"> | |||
| <condition> | |||
| <not> | |||
| <available file="E/1" type="dir" /> | |||
| <available file="${output}/E/1" type="dir" /> | |||
| </not> | |||
| </condition> | |||
| </fail> | |||
| <fail message="E/2 unavailable"> | |||
| <condition> | |||
| <not> | |||
| <available file="E/2" type="file" /> | |||
| <available file="${output}/E/2" type="file" /> | |||
| </not> | |||
| </condition> | |||
| </fail> | |||
| </target> | |||
| <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 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 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 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> | |||
| </project> | |||
| @@ -60,6 +60,7 @@ public class JavaTest extends BuildFileTest { | |||
| */ | |||
| public void setUp() { | |||
| configureProject("src/etc/testcases/taskdefs/java.xml"); | |||
| project.executeTarget("setUp"); | |||
| //final String propname="tests-classpath.value"; | |||
| //String testClasspath=System.getProperty(propname); | |||
| @@ -69,11 +70,6 @@ public class JavaTest extends BuildFileTest { | |||
| runFatalTests=true; | |||
| } | |||
| public void tearDown() { | |||
| // remove log file from testSpawn | |||
| project.executeTarget("cleanup"); | |||
| } | |||
| public void testNoJarNoClassname(){ | |||
| expectBuildExceptionContaining("testNoJarNoClassname", | |||
| "parameter validation", | |||
| @@ -180,7 +176,7 @@ public class JavaTest extends BuildFileTest { | |||
| } | |||
| 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 | |||
| assertTrue("log file not existing", !logFile.exists()); | |||
| project.setProperty("logFile", logFile.getAbsolutePath()); | |||
| @@ -41,7 +41,7 @@ public class MkdirTest extends BuildFileTest { | |||
| public void 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()) { | |||
| fail("mkdir failed"); | |||
| } else { | |||
| @@ -38,15 +38,12 @@ public class MoveTest extends BuildFileTest { | |||
| public void setUp() { | |||
| configureProject("src/etc/testcases/taskdefs/move.xml"); | |||
| } | |||
| public void tearDown() { | |||
| executeTarget("cleanup"); | |||
| project.executeTarget("setUp"); | |||
| } | |||
| public void testFilterSet() throws IOException { | |||
| 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"); | |||
| assertTrue(tmp.exists()); | |||
| assertTrue(FILE_UTILS.contentEquals(tmp, check)); | |||
| @@ -54,7 +51,7 @@ public class MoveTest extends BuildFileTest { | |||
| public void testFilterChain() throws IOException { | |||
| 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"); | |||
| assertTrue(tmp.exists()); | |||
| assertTrue(FILE_UTILS.contentEquals(tmp, check)); | |||
| @@ -63,23 +60,23 @@ public class MoveTest extends BuildFileTest { | |||
| /** Bugzilla Report 11732 */ | |||
| public void testDirectoryRemoval() throws IOException { | |||
| 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 */ | |||
| public void testDirectoryRetaining() throws IOException { | |||
| 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 { | |||
| @@ -92,19 +89,19 @@ public class MoveTest extends BuildFileTest { | |||
| private void testCompleteDirectoryMove(String target) throws IOException { | |||
| 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 | |||
| //assertTrue(!getProject().resolveFile("A").exists()); | |||
| //assertTrue(!new File(getOutputDir(),"A").exists()); | |||
| } | |||
| public void testPathElementMove() throws IOException { | |||
| 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() { | |||