summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorAntoine Levy-Lambert <antoine@apache.org>2014-04-08 11:06:38 +0000
committerAntoine Levy-Lambert <antoine@apache.org>2014-04-08 11:06:38 +0000
commit0d9a9e084149338164a2e73a28d7eea7e62722fe (patch)
tree143b0a2c0bb993522c7ac99a7c74f4f0b9fede3d /src/etc
parentb56846282e0f1e7ca72e4d157ebd4cff9cfe9b43 (diff)
downloadant-0d9a9e084149338164a2e73a28d7eea7e62722fe.tar.gz
changing tests to adopt unique temporary directories
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1585684 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/testcases/taskdefs/optional/depend/depend.xml31
-rw-r--r--src/etc/testcases/taskdefs/optional/i18n/translate/translate.xml49
-rw-r--r--src/etc/testcases/taskdefs/optional/image/image.xml95
-rw-r--r--src/etc/testcases/taskdefs/optional/unix/symlink.xml243
-rw-r--r--src/etc/testcases/taskdefs/rmic/rmic.xml17
-rw-r--r--src/etc/testcases/taskdefs/style/build.xml97
6 files changed, 258 insertions, 274 deletions
diff --git a/src/etc/testcases/taskdefs/optional/depend/depend.xml b/src/etc/testcases/taskdefs/optional/depend/depend.xml
index ad316b13b..d11bf1632 100644
--- a/src/etc/testcases/taskdefs/optional/depend/depend.xml
+++ b/src/etc/testcases/taskdefs/optional/depend/depend.xml
@@ -17,48 +17,50 @@
-->
<project name="depend" basedir="." default="help">
+ <import file="../../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ <property name="tempsrc.dir" value="${output}/tempsrc.dir"/>
+ <property name="cache.dir" value="${output}/tempsrc.dir"/>
+ <property name="classes.dir" value="${output}/classes"/>
+ </target>
+
<property name="src1.dir" value="src1"/>
<property name="src2.dir" value="src2"/>
<property name="src3.dir" value="src3"/>
<property name="src4.dir" value="src4"/>
<property name="src5.dir" value="src5"/>
- <property name="tempsrc.dir" value="working"/>
- <property name="cache.dir" value="working"/>
- <property name="classes.dir" value="classes"/>
<target name="help">
<echo>This buildfile is used as part of Ant's test suite.</echo>
</target>
- <target name="basesetup" depends="clean">
- <mkdir dir="${tempsrc.dir}"/>
- </target>
-
- <target name="src1setup" depends="basesetup">
+ <target name="src1setup" depends="setUp">
<copy todir="${tempsrc.dir}">
<fileset dir="${src1.dir}"/>
</copy>
</target>
- <target name="src2setup" depends="basesetup">
+ <target name="src2setup" depends="setUp">
<copy todir="${tempsrc.dir}">
<fileset dir="${src2.dir}"/>
</copy>
</target>
- <target name="src3setup" depends="basesetup">
+ <target name="src3setup" depends="setUp">
<copy todir="${tempsrc.dir}">
<fileset dir="${src3.dir}"/>
</copy>
</target>
- <target name="src4setup" depends="basesetup">
+ <target name="src4setup" depends="setUp">
<copy todir="${tempsrc.dir}">
<fileset dir="${src4.dir}"/>
</copy>
</target>
- <target name="src5setup" depends="basesetup">
+ <target name="src5setup" depends="setUp">
<copy todir="${tempsrc.dir}">
<fileset dir="${src5.dir}"/>
</copy>
@@ -69,11 +71,6 @@
<javac srcdir="${tempsrc.dir}" destdir="${classes.dir}"/>
</target>
- <target name="clean">
- <delete dir="${classes.dir}"/>
- <delete dir="${tempsrc.dir}"/>
- </target>
-
<target name="testdirect" depends="src1setup, compile">
<sleep seconds="3"/>
<delete file="${tempsrc.dir}/C.java"/>
diff --git a/src/etc/testcases/taskdefs/optional/i18n/translate/translate.xml b/src/etc/testcases/taskdefs/optional/i18n/translate/translate.xml
index a82e5fc72..e6debd500 100644
--- a/src/etc/testcases/taskdefs/optional/i18n/translate/translate.xml
+++ b/src/etc/testcases/taskdefs/optional/i18n/translate/translate.xml
@@ -16,30 +16,29 @@
limitations under the License.
-->
<project name="translate-test" default="test1" basedir=".">
- <property name="input.dir" value="input"/>
- <property name="output.dir" value="output"/>
- <property name="expected.dir" value="expected"/>
- <target name="setup">
- <mkdir dir="${output.dir}/de"/>
- </target>
- <target name="test1" depends="setup">
- <translate toDir="${output.dir}/de"
- starttoken="@"
- endtoken="@"
- bundle="${input.dir}/resources"
- bundlecountry="DE"
- bundlelanguage="ger"
- forceoverwrite="yes"
- srcencoding="ISO8859_1"
- destencoding="ISO8859_1"
- bundleencoding="Cp1252">
- <fileset dir="${input.dir}">
- <include name="template.txt"/>
- </fileset>
- </translate>
- </target>
- <target name="cleanup">
- <delete dir="${output.dir}" quiet="true"/>
- </target>
+ <property name="input.dir" value="input"/>
+ <property name="expected.dir" value="expected"/>
+ <import file="../../../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}/de"/>
+ </target>
+
+ <target name="test1" depends="setUp">
+ <translate toDir="${output}/de"
+ starttoken="@"
+ endtoken="@"
+ bundle="${input.dir}/resources"
+ bundlecountry="DE"
+ bundlelanguage="ger"
+ forceoverwrite="yes"
+ srcencoding="ISO8859_1"
+ destencoding="ISO8859_1"
+ bundleencoding="Cp1252">
+ <fileset dir="${input.dir}">
+ <include name="template.txt"/>
+ </fileset>
+ </translate>
+ </target>
</project>
diff --git a/src/etc/testcases/taskdefs/optional/image/image.xml b/src/etc/testcases/taskdefs/optional/image/image.xml
index bc93b0c40..2fefa04c9 100644
--- a/src/etc/testcases/taskdefs/optional/image/image.xml
+++ b/src/etc/testcases/taskdefs/optional/image/image.xml
@@ -18,59 +18,56 @@
<project name="image-test" default="main" basedir=".">
- <target name="main" depends="testSimpleScale">
- </target>
+ <import file="../../../buildfiletest-base.xml"/>
- <target name="init">
- <property name="src.dir" location="${basedir}/src"/>
- <property name="dest.dir" location="${basedir}/dest"/>
- <mkdir dir="${dest.dir}"/>
- </target>
-
- <target name="cleanup">
- <delete dir="${dest.dir}"/>
- </target>
-
- <!-- this should produce a single file in the dest dir -->
- <target name="testSimpleScale" depends="init">
- <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="no">
- <scale width="300" proportions="width"/>
- </image>
- </target>
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ <property name="src.dir" location="${basedir}/src"/>
+ </target>
- <!-- this should put some text in the log -->
- <target name="testEchoToLog" depends="init">
- <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="no">
- <scale width="300" proportions="width"/>
- </image>
- </target>
-
- <!-- this should produce a single file in the dest dir -->
- <target name="testFailOnError" depends="init">
- <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="no" failonerror="yes">
- <scale width="300" proportions="width"/>
- </image>
- </target>
-
- <!-- this should produce a single file in the dest dir, overwriting any existing file -->
- <target name="testOverwriteTrue" depends="init">
- <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="true" failonerror="no">
- <scale width="300" proportions="width"/>
- </image>
- </target>
+ <target name="main" depends="testSimpleScale">
+ </target>
- <!-- this should not overwrite the existing file -->
- <target name="testOverwriteFalse" depends="init">
- <image includes="*.jpg" srcdir="${src.dir}" destdir="${dest.dir}" overwrite="false" failonerror="no">
- <scale width="300" proportions="width"/>
- </image>
- </target>
-
- <target name="testSimpleScaleWithMapper" depends="init">
+ <!-- this should produce a single file in the dest dir -->
+ <target name="testSimpleScale" depends="setUp">
+ <image includes="*.jpg" srcdir="${src.dir}" destdir="${output}" overwrite="no" failonerror="no">
+ <scale width="300" proportions="width"/>
+ </image>
+ </target>
+
+ <!-- this should put some text in the log -->
+ <target name="testEchoToLog" depends="setUp">
+ <image includes="*.jpg" srcdir="${src.dir}" destdir="${output}" overwrite="no" failonerror="no">
+ <scale width="300" proportions="width"/>
+ </image>
+ </target>
+
+ <!-- this should produce a single file in the dest dir -->
+ <target name="testFailOnError" depends="setUp">
+ <image includes="*.jpg" srcdir="${src.dir}" destdir="${output}" overwrite="no" failonerror="yes">
+ <scale width="300" proportions="width"/>
+ </image>
+ </target>
+
+ <!-- this should produce a single file in the dest dir, overwriting any existing file -->
+ <target name="testOverwriteTrue" depends="setUp">
+ <image includes="*.jpg" srcdir="${src.dir}" destdir="${output}" overwrite="true" failonerror="no">
+ <scale width="300" proportions="width"/>
+ </image>
+ </target>
+
+ <!-- this should not overwrite the existing file -->
+ <target name="testOverwriteFalse" depends="setUp">
+ <image includes="*.jpg" srcdir="${src.dir}" destdir="${output}" overwrite="false" failonerror="no">
+ <scale width="300" proportions="width"/>
+ </image>
+ </target>
+
+ <target name="testSimpleScaleWithMapper" depends="setUp">
<image includes="*.jpg" srcdir="${src.dir}"
- destdir="${dest.dir}" overwrite="no" failonerror="no">
+ destdir="${output}" overwrite="no" failonerror="no">
<scale width="300" proportions="width"/>
<globmapper from="*" to="scaled-*"/>
- </image>
- </target>
+ </image>
+ </target>
</project>
diff --git a/src/etc/testcases/taskdefs/optional/unix/symlink.xml b/src/etc/testcases/taskdefs/optional/unix/symlink.xml
index d257d5c78..bd0131748 100644
--- a/src/etc/testcases/taskdefs/optional/unix/symlink.xml
+++ b/src/etc/testcases/taskdefs/optional/unix/symlink.xml
@@ -46,31 +46,31 @@
<property name="delay" value="3"/>
- <property name="tdir" value="${basedir}/test-working"/>
+ <import file="../../../buildfiletest-base.xml"/>
- <target name="setup">
- <delete dir="${tdir}"/>
- <mkdir dir="${tdir}"/>
+ <target name="setUp">
+ <mkdir dir="${output}" />
</target>
+
<target name="all"
- depends="setup, test-single, test-delete, test-record, test-recreate, teardown"/>
+ depends="setUp, test-single, test-delete, test-record, test-recreate, tearDown"/>
<!-- test for action = single -->
<!--
Creates:
- File: ${tdir}/symlink.test
- Link: ${tdir}/singletest
+ File: ${output}/symlink.test
+ Link: ${output}/singletest
-->
<target name="test-single">
- <touch file="${tdir}/symlink.test"/>
- <symlink resource="${tdir}/symlink.test"
- link="${tdir}/singletest"
+ <touch file="${output}/symlink.test"/>
+ <symlink resource="${output}/symlink.test"
+ link="${output}/singletest"
failonerror="yes"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <available file="${tdir}/symlink.test"
+ <available file="${output}/symlink.test"
property="test.single.file.created"/>
- <available file="${tdir}/singletest"
+ <available file="${output}/singletest"
property="test.single.link.created"/>
</target>
@@ -82,23 +82,23 @@
Creates:
(none)
Deletes:
- Link: ${tdir}/singletest
+ Link: ${output}/singletest
-->
<target name="test-delete">
- <touch file="${tdir}/symlink.test"/>
- <symlink resource="${tdir}/symlink.test"
- link="${tdir}/singletest"
+ <touch file="${output}/symlink.test"/>
+ <symlink resource="${output}/symlink.test"
+ link="${output}/singletest"
failonerror="yes"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <symlink action="delete" link="${tdir}/singletest" failonerror="yes"/>
- <symlink action="delete" link="${tdir}/symlink.test" failonerror="no"/>
+ <symlink action="delete" link="${output}/singletest" failonerror="yes"/>
+ <symlink action="delete" link="${output}/symlink.test" failonerror="no"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <available file="${tdir}/symlink.test"
+ <available file="${output}/symlink.test"
property="test.delete.file.still.there"/>
- <available file="${tdir}/singletest"
+ <available file="${output}/singletest"
property="test.delete.link.still.there"
value="ERROR: link deletion failed"/>
@@ -110,127 +110,127 @@
<!--
Creates:
- Dir: ${tdir}/symtest1
- Dir: ${tdir}/symtest1/symtest2
- Dir: ${tdir}/symtest1/symtest3
- File: ${tdir}/symtest1/file1
- File: ${tdir}/symtest1/symtest2/file2
- File: ${tdir}/symtest1/symtest3/fileA
- File: ${tdir}/symtest1/symtest3/fileB
- File: ${tdir}/symtest1/symtest3/fileC
- Link: ${tdir}/symtest1/link1==>${tdir}/symtest1/file1
- Link: ${tdir}/symtest1/link2==>${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/symtest2/link3==>
- ${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/dirlink==>${tdir}/symtest1/symtest3
- Link: ${tdir}/symtest1/dirlink2==>${tdir}/symtest1/symtest3
- Link: ${tdir}/symtest1/dirlink3==>${tdir}/symtest1/symtest3
- File: ${tdir}/symtest1/recorded.links
- File: ${tdir}/symtest1/symtest2/recorded.links
+ Dir: ${output}/symtest1
+ Dir: ${output}/symtest1/symtest2
+ Dir: ${output}/symtest1/symtest3
+ File: ${output}/symtest1/file1
+ File: ${output}/symtest1/symtest2/file2
+ File: ${output}/symtest1/symtest3/fileA
+ File: ${output}/symtest1/symtest3/fileB
+ File: ${output}/symtest1/symtest3/fileC
+ Link: ${output}/symtest1/link1==>${output}/symtest1/file1
+ Link: ${output}/symtest1/link2==>${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/symtest2/link3==>
+ ${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/dirlink==>${output}/symtest1/symtest3
+ Link: ${output}/symtest1/dirlink2==>${output}/symtest1/symtest3
+ Link: ${output}/symtest1/dirlink3==>${output}/symtest1/symtest3
+ File: ${output}/symtest1/recorded.links
+ File: ${output}/symtest1/symtest2/recorded.links
Deletes:
(none)
-->
<target name="test-record">
- <mkdir dir="${tdir}/symtest1"/>
- <mkdir dir="${tdir}/symtest1/symtest2"/>
- <mkdir dir="${tdir}/symtest1/symtest3"/>
- <touch file="${tdir}/symtest1/file1"/>
- <touch file="${tdir}/symtest1/symtest2/file2"/>
+ <mkdir dir="${output}/symtest1"/>
+ <mkdir dir="${output}/symtest1/symtest2"/>
+ <mkdir dir="${output}/symtest1/symtest3"/>
+ <touch file="${output}/symtest1/file1"/>
+ <touch file="${output}/symtest1/symtest2/file2"/>
- <touch file="${tdir}/symtest1/symtest3/fileA"/>
- <touch file="${tdir}/symtest1/symtest3/fileB"/>
- <touch file="${tdir}/symtest1/symtest3/fileC"/>
+ <touch file="${output}/symtest1/symtest3/fileA"/>
+ <touch file="${output}/symtest1/symtest3/fileB"/>
+ <touch file="${output}/symtest1/symtest3/fileC"/>
- <symlink resource="${tdir}/symtest1/file1"
- link="${tdir}/symtest1/link1"
+ <symlink resource="${output}/symtest1/file1"
+ link="${output}/symtest1/link1"
failonerror="no" />
- <symlink resource="${tdir}/symtest1/symtest2/file2"
- link="${tdir}/symtest1/link2"
+ <symlink resource="${output}/symtest1/symtest2/file2"
+ link="${output}/symtest1/link2"
failonerror="no" />
- <symlink resource="${tdir}/symtest1/symtest2/file2"
- link="${tdir}/symtest1/symtest2/link3"
+ <symlink resource="${output}/symtest1/symtest2/file2"
+ link="${output}/symtest1/symtest2/link3"
failonerror="no" />
- <symlink resource="${tdir}/symtest1/symtest3"
- link="${tdir}/symtest1/dirlink"
+ <symlink resource="${output}/symtest1/symtest3"
+ link="${output}/symtest1/dirlink"
failonerror="no" />
- <symlink resource="${tdir}/symtest1/symtest3"
- link="${tdir}/symtest1/dirlink2"
+ <symlink resource="${output}/symtest1/symtest3"
+ link="${output}/symtest1/dirlink2"
failonerror="no"/>
- <symlink resource="${tdir}/symtest1/symtest3"
- link="${tdir}/symtest1/dirlink3"
+ <symlink resource="${output}/symtest1/symtest3"
+ link="${output}/symtest1/dirlink3"
failonerror="no"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
<symlink action="record" linkfilename="recorded.links">
- <fileset dir="${tdir}/symtest1" includes="**/**"/>
+ <fileset dir="${output}/symtest1" includes="**/**"/>
</symlink>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
<!-- Test to see if the directories were created -->
- <available file="${tdir}/symtest1"
+ <available file="${output}/symtest1"
type="dir"
property="test.record.dir1.created"/>
- <available file="${tdir}/symtest1/symtest2"
+ <available file="${output}/symtest1/symtest2"
type="dir"
property="test.record.dir2.created"/>
- <available file="${tdir}/symtest1/symtest3"
+ <available file="${output}/symtest1/symtest3"
type="dir"
property="test.record.dir3.created"/>
<!-- Test to see if the Files were created -->
- <available file="${tdir}/symtest1/file1"
+ <available file="${output}/symtest1/file1"
property="test.record.file1.created"/>
- <available file="${tdir}/symtest1/symtest2/file2"
+ <available file="${output}/symtest1/symtest2/file2"
property="test.record.file2.created"/>
- <available file="${tdir}/symtest1/symtest3/fileA"
+ <available file="${output}/symtest1/symtest3/fileA"
property="test.record.fileA.created"/>
- <available file="${tdir}/symtest1/symtest3/fileB"
+ <available file="${output}/symtest1/symtest3/fileB"
property="test.record.fileB.created"/>
- <available file="${tdir}/symtest1/symtest3/fileC"
+ <available file="${output}/symtest1/symtest3/fileC"
property="test.record.fileC.created"/>
<!-- Test to see if the links were created -->
- <available file="${tdir}/symtest1/link1"
+ <available file="${output}/symtest1/link1"
property="test.record.link1.created"/>
- <available file="${tdir}/symtest1/link2"
+ <available file="${output}/symtest1/link2"
property="test.record.link2.created"/>
- <available file="${tdir}/symtest1/symtest2/link3"
+ <available file="${output}/symtest1/symtest2/link3"
property="test.record.link3.created"/>
- <available file="${tdir}/symtest1/dirlink"
+ <available file="${output}/symtest1/dirlink"
property="test.record.dirlink.created"/>
<!-- this is redundant for this test, but used in the recreate test -->
- <available file="${tdir}/symtest1/dirlink2"
+ <available file="${output}/symtest1/dirlink2"
property="test.record.dirlink2.created"/>
<!-- Test to see if the linkfiles were created -->
- <available file="${tdir}/symtest1/recorded.links"
+ <available file="${output}/symtest1/recorded.links"
property="test.record.dir1.recorded"/>
- <available file="${tdir}/symtest1/symtest2/recorded.links"
+ <available file="${output}/symtest1/symtest2/recorded.links"
property="test.record.dir2.recorded"/>
<!-- THIS should not be set -->
- <available file="${tdir}/symtest1/symtest3/recorded.links"
+ <available file="${output}/symtest1/symtest3/recorded.links"
property="test.record.dir3.recorded"
value="ERROR: symtest3/recorded.links should not exist"/>
@@ -241,95 +241,95 @@
<!--
Deletes:
- Link: ${tdir}/symtest1/link1==>${tdir}/symtest1/file1
- Link: ${tdir}/symtest1/link2==>${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/symtest2/link3==>
- ${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/dirlink==>${tdir}/symtest1/symtest3
- Link: ${tdir}/symtest1/dirlink3==>${tdir}/symtest1/symtest3
+ Link: ${output}/symtest1/link1==>${output}/symtest1/file1
+ Link: ${output}/symtest1/link2==>${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/symtest2/link3==>
+ ${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/dirlink==>${output}/symtest1/symtest3
+ Link: ${output}/symtest1/dirlink3==>${output}/symtest1/symtest3
Creates
- Link: ${tdir}/symtest1/dirlink3==>${tdir}/symtest1/symtest2
+ Link: ${output}/symtest1/dirlink3==>${output}/symtest1/symtest2
Recreates:
- Link: ${tdir}/symtest1/link1==>${tdir}/symtest1/file1
- Link: ${tdir}/symtest1/link2==>${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/symtest2/link3==>
- ${tdir}/symtest1/symtest2/file2
- Link: ${tdir}/symtest1/dirlink==>${tdir}/symtest1/symtest3
+ Link: ${output}/symtest1/link1==>${output}/symtest1/file1
+ Link: ${output}/symtest1/link2==>${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/symtest2/link3==>
+ ${output}/symtest1/symtest2/file2
+ Link: ${output}/symtest1/dirlink==>${output}/symtest1/symtest3
Should Change:
- Link: ${tdir}/symtest1/dirlink3==>${tdir}/symtest1/symtest2
+ Link: ${output}/symtest1/dirlink3==>${output}/symtest1/symtest2
to
- ${tdir}/symtest1/dirlink3==>${tdir}/symtest1/symtest3
+ ${output}/symtest1/dirlink3==>${output}/symtest1/symtest3
Should Not Create (bug 25181):
- Link: ${tdir}/symtest1/symtest3/dirlink2==>${tdir}/symtest1/symtest3
+ Link: ${output}/symtest1/symtest3/dirlink2==>${output}/symtest1/symtest3
-->
<target name="test-recreate" depends="test-record">
- <symlink action="delete" link="${tdir}/symtest1/link1"/>
- <symlink action="delete" link="${tdir}/symtest1/link2"/>
- <symlink action="delete" link="${tdir}/symtest1/symtest2/link3"/>
- <symlink action="delete" link="${tdir}/symtest1/dirlink"/>
+ <symlink action="delete" link="${output}/symtest1/link1"/>
+ <symlink action="delete" link="${output}/symtest1/link2"/>
+ <symlink action="delete" link="${output}/symtest1/symtest2/link3"/>
+ <symlink action="delete" link="${output}/symtest1/dirlink"/>
<!-- dirlink2 intentionally not deleted to test bug 25181 -->
- <symlink action="delete" link="${tdir}/symtest1/dirlink3"/>
+ <symlink action="delete" link="${output}/symtest1/dirlink3"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <symlink resource="${tdir}/symtest1/symtest2"
- link="${tdir}/symtest1/dirlink3"
+ <symlink resource="${output}/symtest1/symtest2"
+ link="${output}/symtest1/dirlink3"
failonerror="no"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <available file="${tdir}/symtest1/link1"
+ <available file="${output}/symtest1/link1"
property="test.recreate.link1.not.removed"
value="ERROR: rm -f symtest1/link1 failed"/>
- <available file="${tdir}/symtest1/link2"
+ <available file="${output}/symtest1/link2"
property="test.recreate.link2.not.removed"
value="ERROR: rm -f symtest1/link2 failed"/>
- <available file="${tdir}/symtest1/symtest2/link3"
+ <available file="${output}/symtest1/symtest2/link3"
property="test.recreate.link3.not.removed"
value="ERROR: rm -f symtest1/symtest2/link3 failed"/>
- <available file="${tdir}/symtest1/zdirlink"
+ <available file="${output}/symtest1/zdirlink"
property="test.recreate.zdirlink.not.removed"
value="ERROR: rm -f symtest1/zdirlink failed"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to do the execs -->
<symlink action="recreate">
- <fileset dir="${tdir}/symtest1" includes="**/recorded.links"/>
+ <fileset dir="${output}/symtest1" includes="**/recorded.links"/>
</symlink>
<sleep seconds="${delay}"/> <!-- make sure OS has time to catch up -->
- <available file="${tdir}/symtest1/link1"
+ <available file="${output}/symtest1/link1"
property="test.recreate.link1.recreated"/>
- <available file="${tdir}/symtest1/link2"
+ <available file="${output}/symtest1/link2"
property="test.recreate.link2.recreated"/>
- <available file="${tdir}/symtest1/symtest2/link3"
+ <available file="${output}/symtest1/symtest2/link3"
property="test.recreate.link3.recreated"/>
- <available file="${tdir}/symtest1/dirlink"
+ <available file="${output}/symtest1/dirlink"
property="test.recreate.dirlink.recreated"/>
<!-- this should not get set -->
- <available file="${tdir}/symtest1/symtest3/symtest3"
+ <available file="${output}/symtest1/symtest3/symtest3"
property="test.recreate.dirlink2.recreated.twice"
value="ERROR: dirlink2 was created a second time (bug 25181)"/>
- <touch file="${tdir}/symtest1/dirlink3/WhereAmI"/>
+ <touch file="${output}/symtest1/dirlink3/WhereAmI"/>
<sleep seconds="${delay}"/> <!-- make sure OS has time to do the execs -->
- <available file="${tdir}/symtest1/symtest3/WhereAmI"
+ <available file="${output}/symtest1/symtest3/WhereAmI"
property="test.recreate.dirlink3.was.altered"/>
</target>
@@ -337,23 +337,18 @@
<!-- actually tests the symlink methods in FileUtils, but this
testfixture already has all the necessary envirnment in place
-->
- <target name="test-fileutils" depends="setup">
- <mkdir dir="${tdir}/dir1"/>
- <mkdir dir="${tdir}/dir2"/>
- <touch file="${tdir}/file1"/>
- <touch file="${tdir}/file2"/>
- <symlink link="${tdir}/dir.there" resource="${tdir}/dir1"/>
- <symlink link="${tdir}/dir.notthere" resource="${tdir}/dir2"/>
- <symlink link="${tdir}/file.there" resource="${tdir}/file1"/>
- <symlink link="${tdir}/file.notthere" resource="${tdir}/file2"/>
- <delete dir="${tdir}/dir2"/>
- <delete file="${tdir}/file2"/>
+ <target name="test-fileutils" depends="setUp">
+ <mkdir dir="${output}/dir1"/>
+ <mkdir dir="${output}/dir2"/>
+ <touch file="${output}/file1"/>
+ <touch file="${output}/file2"/>
+ <symlink link="${output}/dir.there" resource="${output}/dir1"/>
+ <symlink link="${output}/dir.notthere" resource="${output}/dir2"/>
+ <symlink link="${output}/file.there" resource="${output}/file1"/>
+ <symlink link="${output}/file.notthere" resource="${output}/file2"/>
+ <delete dir="${output}/dir2"/>
+ <delete file="${output}/file2"/>
</target>
-<!-- CALL THIS to clean things up afterwards -->
-
- <target name="teardown">
- <delete dir="${tdir}"/>
- </target>
</project>
diff --git a/src/etc/testcases/taskdefs/rmic/rmic.xml b/src/etc/testcases/taskdefs/rmic/rmic.xml
index d8709bd07..757fca517 100644
--- a/src/etc/testcases/taskdefs/rmic/rmic.xml
+++ b/src/etc/testcases/taskdefs/rmic/rmic.xml
@@ -15,20 +15,23 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project name="rmic" default="teardown" basedir=".">
+<project name="rmic" default="tearDown" basedir=".">
<property name="rmic.dir" location="." />
<property name="src.dir" location="${rmic.dir}/src"/>
- <property name="build.dir" location="${java.io.tmpdir}/build"/>
- <property name="dest.dir" location="${java.io.tmpdir}/dest"/>
- <target name="teardown">
- <delete dir="${build.dir}"/>
- <delete dir="${dest.dir}"/>
+ <import file="../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ <property name="build.dir" location="${output}/build"/>
+ <property name="dest.dir" location="${output}/dest"/>
</target>
+
+
<!-- init builds the java source -->
- <target name="init" depends="probe-rmic">
+ <target name="init" depends="probe-rmic,setUp">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dest.dir}"/>
diff --git a/src/etc/testcases/taskdefs/style/build.xml b/src/etc/testcases/taskdefs/style/build.xml
index 1b0d35e6a..c91d10f69 100644
--- a/src/etc/testcases/taskdefs/style/build.xml
+++ b/src/etc/testcases/taskdefs/style/build.xml
@@ -16,59 +16,55 @@
limitations under the License.
-->
-<project name="xslt-test" basedir="." default="nothing">
+<project name="xslt-test" basedir="." default="tearDown">
- <property name="out.dir" value="out"/>
+ <import file="../../buildfiletest-base.xml"/>
-
- <target name="setup">
+ <target name="setUp">
+ <mkdir dir="${output}" />
</target>
- <target name="teardown">
- <delete dir="${out.dir}" failonerror="false" />
- </target>
-
<target name="testStyleIsSet">
- <xslt in="data.xml" out="${out.dir}/out.xml"/>
+ <xslt in="data.xml" out="${output}/out.xml"/>
</target>
<target name="testTransferParameterSet">
<property name="value" value="myvalue"/>
- <xslt in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
+ <xslt in="data.xml" out="${output}/out.xml" style="printParams.xsl">
<param name="set" expression="${value}"/>
</xslt>
</target>
<target name="testTransferParameterEmpty">
<property name="value" value=""/>
- <xslt in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
+ <xslt in="data.xml" out="${output}/out.xml" style="printParams.xsl">
<param name="empty" expression="${value}"/>
</xslt>
</target>
<target name="testTransferParameterUnset">
- <xslt in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
+ <xslt in="data.xml" out="${output}/out.xml" style="printParams.xsl">
<param name="undefined" expression="${value}"/>
</xslt>
</target>
<target name="testTransferParameterUnsetWithIf">
- <xslt in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
+ <xslt in="data.xml" out="${output}/out.xml" style="printParams.xsl">
<param name="undefined" expression="${value}" if="value" />
</xslt>
</target>
<target name="testDefaultMapper">
<property name="value" value="myvalue"/>
- <xslt style="printParams.xsl" destDir="${out.dir}" basedir=".">
+ <xslt style="printParams.xsl" destDir="${output}" basedir=".">
<param name="set" expression="${value}"/>
</xslt>
</target>
<target name="testCustomMapper">
<property name="value" value="myvalue"/>
- <xslt style="printParams.xsl" destDir="${out.dir}" basedir=".">
+ <xslt style="printParams.xsl" destDir="${output}" basedir=".">
<param name="set" expression="${value}"/>
<mapper type="glob" from="data.*" to="out.*"/>
</xslt>
@@ -76,7 +72,7 @@
<target name="testTypedMapper">
<property name="value" value="myvalue"/>
- <xslt style="printParams.xsl" destDir="${out.dir}" basedir=".">
+ <xslt style="printParams.xsl" destDir="${output}" basedir=".">
<param name="set" expression="${value}"/>
<globmapper from="data.*" to="out.*"/>
</xslt>
@@ -84,7 +80,7 @@
<target name="testExplicitFileset">
<property name="value" value="myvalue"/>
- <xslt style="printParams.xsl" destDir="${out.dir}"
+ <xslt style="printParams.xsl" destDir="${output}"
useImplicitFileset="false" basedir="..">
<param name="set" expression="${value}"/>
<fileset dir="."/>
@@ -95,26 +91,26 @@
<antcall target="copyXsl">
<param name="xsl.value" value="old-value"/>
</antcall>
- <xslt in="data.xml" out="${out.dir}/out.xml" style="tmp.xsl"/>
+ <xslt in="data.xml" out="${output}/out.xml" style="tmp.xsl"/>
<antcall target="copyXsl">
<param name="xsl.value" value="new-value"/>
</antcall>
- <xslt in="data.xml" out="${out.dir}/out.xml" style="tmp.xsl"/>
+ <xslt in="data.xml" out="${output}/out.xml" style="tmp.xsl"/>
<delete file="tmp.xsl"/>
</target>
<target name="testDirectoryHierarchyWithDirMatching">
- <mkdir dir="${out.dir}/src/level1/"/>
- <copy file="data.xml" todir="${out.dir}/src/level1/"/>
- <xslt basedir="${out.dir}/src" destdir="${out.dir}/dest"
+ <mkdir dir="${output}/src/level1/"/>
+ <copy file="data.xml" todir="${output}/src/level1/"/>
+ <xslt basedir="${output}/src" destdir="${output}/dest"
style="printParams.xsl"/>
</target>
<target name="testDirsWithSpaces">
- <mkdir dir="${out.dir}/s rc/"/>
- <copy file="data.xml" todir="${out.dir}/s rc/"/>
- <xslt basedir="${out.dir}/s rc" destdir="${out.dir}/d est"
+ <mkdir dir="${output}/s rc/"/>
+ <copy file="data.xml" todir="${output}/s rc/"/>
+ <xslt basedir="${output}/s rc" destdir="${output}/d est"
style="printParams.xsl"/>
</target>
@@ -127,13 +123,13 @@
<target name="testWithStyleAttrAndResource">
<!-- also testing style as resources, with refid -->
<file id="xslFile" file="printParams.xsl"/>
- <xslt in="data.xml" out="${out.dir}/out.xml" style="printParams.xsl">
+ <xslt in="data.xml" out="${output}/out.xml" style="printParams.xsl">
<style refid="xslFile" />
</xslt>
</target>
<target name="testWithFileResource">
- <xslt in="data.xml" out="${out.dir}/out.xml">
+ <xslt in="data.xml" out="${output}/out.xml">
<style>
<file file="printParams.xsl"/>
</style>
@@ -143,7 +139,7 @@
<target name="testWithUrlResource">
<makeurl file="printParams.xsl" property="printParams.xsl.url"/>
- <xslt in="data.xml" out="${out.dir}/out.xml">
+ <xslt in="data.xml" out="${output}/out.xml">
<style>
<url url="${printParams.xsl.url}"/>
</style>
@@ -152,15 +148,14 @@
</target>
<target name="testFilenameAndFiledirAsParam">
- <mkdir dir="${out.dir}/xml/dir"/>
- <mkdir dir="${out.dir}/out"/>
- <copy file="data.xml" tofile="${out.dir}/xml/one.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/two.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/three.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/dir/four.xml"/>
+ <mkdir dir="${output}/xml/dir"/>
+ <copy file="data.xml" tofile="${output}/xml/one.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/two.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/three.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/dir/four.xml"/>
<xslt style="printFilename.xsl"
- destdir="${out.dir}/out"
- basedir="${out.dir}/xml"
+ destdir="${output}"
+ basedir="${output}/xml"
includes="**/*.xml"
extension=".txt"
@@ -170,15 +165,14 @@
</target>
<target name="testFilenameAsParam">
- <mkdir dir="${out.dir}/xml/dir"/>
- <mkdir dir="${out.dir}/out"/>
- <copy file="data.xml" tofile="${out.dir}/xml/one.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/two.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/three.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/dir/four.xml"/>
+ <mkdir dir="${output}/xml/dir"/>
+ <copy file="data.xml" tofile="${output}/xml/one.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/two.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/three.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/dir/four.xml"/>
<xslt style="printFilename.xsl"
- destdir="${out.dir}/out"
- basedir="${out.dir}/xml"
+ destdir="${output}"
+ basedir="${output}/xml"
includes="**/*.xml"
extension=".txt"
@@ -187,15 +181,14 @@
</target>
<target name="testFilenameAsParamNoSetting">
- <mkdir dir="${out.dir}/xml/dir"/>
- <mkdir dir="${out.dir}/out"/>
- <copy file="data.xml" tofile="${out.dir}/xml/one.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/two.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/three.xml"/>
- <copy file="data.xml" tofile="${out.dir}/xml/dir/four.xml"/>
+ <mkdir dir="${output}/xml/dir"/>
+ <copy file="data.xml" tofile="${output}/xml/one.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/two.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/three.xml"/>
+ <copy file="data.xml" tofile="${output}/xml/dir/four.xml"/>
<xslt style="printFilename.xsl"
- destdir="${out.dir}/out"
- basedir="${out.dir}/xml"
+ destdir="${output}"
+ basedir="${output}/xml"
includes="**/*.xml"
extension=".txt"
/> <!-- without 'filenameparameter' to check, that the xsl:param is NOT set -->