You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by an...@apache.org on 2014/04/07 03:53:28 UTC
svn commit: r1585372 [1/2] - in /ant/core/trunk/src: etc/testcases/taskdefs/
etc/testcases/taskdefs/exec/ etc/testcases/taskdefs/fixcrlf/
etc/testcases/taskdefs/optional/ tests/junit/org/apache/tools/ant/taskdefs/
tests/junit/org/apache/tools/ant/taskd...
Author: antoine
Date: Mon Apr 7 01:53:27 2014
New Revision: 1585372
URL: http://svn.apache.org/r1585372
Log:
creating temporary directory with a unique name
Modified:
ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml
ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml
ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml
ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml
ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml
ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml
ant/core/trunk/src/etc/testcases/taskdefs/property.xml
ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml
ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml
ant/core/trunk/src/etc/testcases/taskdefs/replace.xml
ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml
ant/core/trunk/src/etc/testcases/taskdefs/sync.xml
ant/core/trunk/src/etc/testcases/taskdefs/war.xml
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestListenerTest.java
Modified: ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/exec/exec.xml Mon Apr 7 01:53:27 2014
@@ -16,56 +16,54 @@
limitations under the License.
-->
<project name="exec-test" default="spawn" basedir=".">
- <property name="output" location="${java.io.tmpdir}/testoutput"/>
- <target name="init">
- <!-- this property can be overriden programatically in the Java test case -->
- <property name="timeToWait" value="10"/>
- <!-- this property can be overriden programatically in the Java test case -->
- <mkdir dir="${output}"/>
- <property name="logFile" value="${output}/spawn.log"/>
- <property environment="env"/>
- <!-- UNIX -->
- <available file="sh" filepath="${env.PATH}" property="sh.executable"/>
- <!-- CYGWIN -->
- <available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable"/>
- <!-- WINDOWS + CYGWIN -->
- <available file="sh.exe" filepath="${env.Path}" property="sh.exe.executable"/>
- <condition property="test.can.run">
- <or>
- <isset property="sh.executable"/>
- <isset property="sh.exe.executable"/>
- </or>
- </condition>
- </target>
+ <import file="../../buildfiletest-base.xml"/>
- <target name="spawn" depends="init" if="test.can.run">
- <exec executable="sh" spawn="true">
- <arg value="spawn.sh"/>
- <arg value="${timeToWait}" />
- <arg value="${logFile}" />
- </exec>
- </target>
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ <!-- this property can be overriden programatically in the Java test case -->
+ <property name="timeToWait" value="10"/>
+ <!-- this property can be overriden programatically in the Java test case -->
+ <property name="logFile" value="${output}/spawn.log"/>
+ <property environment="env"/>
+ <!-- UNIX -->
+ <available file="sh" filepath="${env.PATH}" property="sh.executable"/>
+ <!-- CYGWIN -->
+ <available file="sh.exe" filepath="${env.PATH}" property="sh.exe.executable"/>
+ <!-- WINDOWS + CYGWIN -->
+ <available file="sh.exe" filepath="${env.Path}" property="sh.exe.executable"/>
+ <condition property="test.can.run">
+ <or>
+ <isset property="sh.executable"/>
+ <isset property="sh.exe.executable"/>
+ </or>
+ </condition>
+ </target>
- <target name="test-out-and-err" description="see https://issues.apache.org/bugzilla/show_bug.cgi?id=50507" depends="init" if="test.can.run">
- <mkdir dir="${output}" />
- <ant antfile="blabla.xml" output="${output}/test-out-and-err.txt">
- </ant>
- <loadfile srcfile="${output}/test-out-and-err.txt" property="test-out-and-err">
- <filterchain>
- <replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla error message err$" flags="m" />
- <replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla info message out$" flags="m" />
- </filterchain>
- </loadfile>
- <fail message="output indicates a mixup of out and err: '${test-out-and-err}'">
- <condition>
- <contains string="${test-out-and-err}" substring="[exec]" />
- </condition>
- </fail>
+ <target name="spawn" depends="setUp" if="test.can.run">
+ <exec executable="sh" spawn="true">
+ <arg value="spawn.sh"/>
+ <arg value="${timeToWait}"/>
+ <arg value="${logFile}"/>
+ </exec>
+ </target>
- </target>
+ <target name="test-out-and-err" description="see https://issues.apache.org/bugzilla/show_bug.cgi?id=50507"
+ depends="setUp" if="test.can.run">
+ <mkdir dir="${output}"/>
+ <ant antfile="blabla.xml" output="${output}/test-out-and-err.txt">
+ </ant>
+ <loadfile srcfile="${output}/test-out-and-err.txt" property="test-out-and-err">
+ <filterchain>
+ <replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla error message err$" flags="m"/>
+ <replaceregex pattern="^\s*\[exec\] some blablablablablablablablablablablabla info message out$" flags="m"/>
+ </filterchain>
+ </loadfile>
+ <fail message="output indicates a mixup of out and err: '${test-out-and-err}'">
+ <condition>
+ <contains string="${test-out-and-err}" substring="[exec]"/>
+ </condition>
+ </fail>
+
+ </target>
- <target name="cleanup">
- <delete file="${logFile}"/>
- <delete dir="${output}"/>
- </target>
</project>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/fixcrlf/build.xml Mon Apr 7 01:53:27 2014
@@ -16,18 +16,17 @@
limitations under the License.
-->
<project name="fixcrlf" default="cleanup" basedir=".">
- <target name="init">
- <mkdir dir="result" />
- </target>
+ <import file="../../buildfiletest-base.xml"/>
- <target name="cleanup">
- <delete dir="result" />
+ <target name="setUp">
+ <mkdir dir="${output}" />
</target>
+
<macrodef name="assertequal">
<attribute name="junk" default="" />
<attribute name="name" default="Junk@{junk}.java" />
- <attribute name="file1" default="result/@{name}" />
+ <attribute name="file1" default="${output}/@{name}" />
<attribute name="file2" default="expected/@{name}" />
<sequential>
<fail message="@{file1} and @{file2} are different">
@@ -40,84 +39,84 @@
</sequential>
</macrodef>
- <target name="test1" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test1" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk1.java"
javafiles="true" tab="add" eol="crlf" eof="asis" />
<assertequal junk="1" />
</target>
- <target name="test2" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test2" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk2.java"
javafiles="true" tab="add" cr="add" eol="crlf" eof="asis" />
<assertequal junk="2" />
</target>
- <target name="test3" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test3" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk3.java"
javafiles="true" tab="remove" eol="lf" eof="asis" />
<assertequal junk="3" />
</target>
- <target name="test4" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test4" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk4.java"
javafiles="true" tab="remove" eol="lf" eof="asis" />
<assertequal junk="4" />
</target>
- <target name="test5" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test5" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk5.java"
tab="remove" eol="lf" eof="asis" />
<assertequal junk="5" />
</target>
- <target name="test6" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test6" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk6.java"
tab="add" cr="remove" eol="crlf" eof="asis" />
<assertequal junk="6" />
</target>
- <target name="test7" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test7" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk7.java"
tab="add" cr="add" eof="asis" />
<assertequal junk="7" />
</target>
- <target name="test8" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test8" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk8.java"
javafiles="true" tab="add" cr="add" eof="add" />
<assertequal junk="8" />
</target>
- <target name="test9" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="test9" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk9.java"
javafiles="true" tab="remove" cr="remove" eof="remove" />
<assertequal junk="9" />
</target>
- <target name="testMacLines" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testMacLines" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Mac2Unix" eol="lf" />
<assertequal name="Mac2Unix" />
</target>
<target name="testNoOverwrite" depends="test1">
- <touch file="result/Junk1.java" millis="0" />
- <fixcrlf srcdir="input" destdir="result"
+ <touch file="${output}/Junk1.java" millis="0" />
+ <fixcrlf srcdir="input" destdir="${output}"
includes="Junk1.java" preservelastmodified="false"
javafiles="true" tab="add" eol="crlf" eof="asis" />
<fail message="overwrote unchanged output file">Q
<condition>
<not>
- <isfileselected file="result/Junk1.java">
+ <isfileselected file="${output}/Junk1.java">
<date when="equal" millis="0" />
</isfileselected>
</not>
@@ -125,112 +124,112 @@
</fail>
</target>
- <target name="testEncoding" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testEncoding" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="input.crlf.utf16"
javafiles="false" cr="remove" encoding="UnicodeBig" />
- <assertequal file1="result/input.crlf.utf16"
+ <assertequal file1="${output}/input.crlf.utf16"
file2="expected/input.lf.utf16" />
</target>
- <target name="testOutputEncoding" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testOutputEncoding" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="input.crlf.utf16"
javafiles="false" eol="lf" encoding="UnicodeBig"
outputencoding="ascii" />
- <assertequal file1="result/input.crlf.utf16"
+ <assertequal file1="${output}/input.crlf.utf16"
file2="expected/input.lf.ascii" />
</target>
- <target name="testLongLines" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testLongLines" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="longlines.crlf"
javafiles="false" cr="remove" />
- <assertequal file1="result/longlines.crlf"
+ <assertequal file1="${output}/longlines.crlf"
file2="expected/longlines.lf" />
</target>
- <target name="testCrCrLfSequence-unix" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testCrCrLfSequence-unix" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="crcrlf" eol="lf" />
- <assertequal file1="result/crcrlf"
+ <assertequal file1="${output}/crcrlf"
file2="expected/crcrlf.unix" />
</target>
- <target name="testCrCrLfSequence-dos" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testCrCrLfSequence-dos" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="crcrlf" eol="crlf" />
- <assertequal file1="result/crcrlf"
+ <assertequal file1="${output}/crcrlf"
file2="expected/crcrlf.dos" />
</target>
- <target name="testCrCrLfSequence-mac" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testCrCrLfSequence-mac" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="crcrlf" eol="cr" />
- <assertequal file1="result/crcrlf"
+ <assertequal file1="${output}/crcrlf"
file2="expected/crcrlf.mac" />
</target>
- <target name="testFixlastDos" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testFixlastDos" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="fixlastfalse.lf" eol="crlf" />
- <assertequal file1="result/fixlastfalse.lf"
+ <assertequal file1="${output}/fixlastfalse.lf"
file2="expected/fixlast.dos" />
</target>
- <target name="testFixlastFalseMac" depends="init">
- <fixcrlf srcdir="input" destdir="result"
+ <target name="testFixlastFalseMac" depends="setUp">
+ <fixcrlf srcdir="input" destdir="${output}"
includes="fixlastfalse.lf" eol="cr" fixlast="false" />
- <assertequal file1="result/fixlastfalse.lf"
+ <assertequal file1="${output}/fixlastfalse.lf"
file2="expected/fixlastfalse.mac" />
</target>
<!-- Bugzilla Report 20840 -->
- <target name="createParentDirs" depends="init">
- <fixcrlf srcdir="." destdir="result" includes="input/Junk1.java" />
+ <target name="createParentDirs" depends="setUp">
+ <fixcrlf srcdir="." destdir="${output}" includes="input/Junk1.java" />
</target>
- <target name="testFixFile" depends="init">
- <fixcrlf file="input/longlines.crlf" destdir="result" />
+ <target name="testFixFile" depends="setUp">
+ <fixcrlf file="input/longlines.crlf" destdir="${output}" />
<fail message="didn't create output file">
<condition>
<not>
- <available file="result/longlines.crlf" />
+ <available file="${output}/longlines.crlf" />
</not>
</condition>
</fail>
</target>
- <target name="testFixFileExclusive" depends="init">
- <fixcrlf file="input/longlines.crlf" srcdir="input" destdir="result"/>
+ <target name="testFixFileExclusive" depends="setUp">
+ <fixcrlf file="input/longlines.crlf" srcdir="input" destdir="${output}"/>
</target>
- <target name="testPreserveLastModified" depends="init">
- <fixcrlf file="input/longlines.crlf" destdir="result"
+ <target name="testPreserveLastModified" depends="setUp">
+ <fixcrlf file="input/longlines.crlf" destdir="${output}"
preservelastmodified="true" />
<fail>
<condition>
<not>
- <uptodate srcfile="result/longlines.crlf"
+ <uptodate srcfile="${output}/longlines.crlf"
targetfile="input/longlines.crlf" />
</not>
</condition>
</fail>
- <touch file="result/longlines.crlf" millis="0" />
+ <touch file="${output}/longlines.crlf" millis="0" />
- <fixcrlf file="result/longlines.crlf" destdir="result" eol="lf"
+ <fixcrlf file="${output}/longlines.crlf" destdir="${output}" eol="lf"
preservelastmodified="true" />
- <fileset id="fs" file="result/longlines.crlf">
+ <fileset id="fs" file="${output}/longlines.crlf">
<date when="equal" millis="0" />
</fileset>
<property name="fs" refid="fs" />
<fail unless="fs" />
</target>
- <target name="testFilter1" depends="init">
- <copy file="input/Junk1.java" todir="result" overwrite="true">
+ <target name="testFilter1" depends="setUp">
+ <copy file="input/Junk1.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="add"
eol="crlf" eof="asis" />
@@ -239,8 +238,8 @@
<assertequal junk="1" />
</target>
- <target name="testFilter2" depends="init">
- <copy file="input/Junk2.java" todir="result" overwrite="true">
+ <target name="testFilter2" depends="setUp">
+ <copy file="input/Junk2.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="add" cr="add" eol="crlf" eof="asis" />
</filterchain>
@@ -248,8 +247,8 @@
<assertequal junk="2" />
</target>
- <target name="testFilter3" depends="init">
- <copy file="input/Junk3.java" todir="result" overwrite="true">
+ <target name="testFilter3" depends="setUp">
+ <copy file="input/Junk3.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="remove" eol="lf" eof="asis" />
</filterchain>
@@ -257,8 +256,8 @@
<assertequal junk="3" />
</target>
- <target name="testFilter4" depends="init">
- <copy file="input/Junk4.java" todir="result" overwrite="true">
+ <target name="testFilter4" depends="setUp">
+ <copy file="input/Junk4.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="remove" eol="lf" eof="asis" />
</filterchain>
@@ -266,8 +265,8 @@
<assertequal junk="4" />
</target>
- <target name="testFilter5" depends="init">
- <copy file="input/Junk5.java" todir="result" overwrite="true">
+ <target name="testFilter5" depends="setUp">
+ <copy file="input/Junk5.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf tab="remove" eol="lf" eof="asis" />
</filterchain>
@@ -275,8 +274,8 @@
<assertequal junk="5" />
</target>
- <target name="testFilter6" depends="init">
- <copy file="input/Junk6.java" todir="result" overwrite="true">
+ <target name="testFilter6" depends="setUp">
+ <copy file="input/Junk6.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf tab="add" cr="remove" eol="crlf" eof="asis" />
</filterchain>
@@ -284,8 +283,8 @@
<assertequal junk="6" />
</target>
- <target name="testFilter7" depends="init">
- <copy file="input/Junk7.java" todir="result" overwrite="true">
+ <target name="testFilter7" depends="setUp">
+ <copy file="input/Junk7.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf tab="add" cr="add" eof="asis" />
</filterchain>
@@ -293,8 +292,8 @@
<assertequal junk="7" />
</target>
- <target name="testFilter8" depends="init">
- <copy file="input/Junk8.java" todir="result" overwrite="true">
+ <target name="testFilter8" depends="setUp">
+ <copy file="input/Junk8.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="add" cr="add" eof="add" />
</filterchain>
@@ -302,8 +301,8 @@
<assertequal junk="8" />
</target>
- <target name="testFilter9" depends="init">
- <copy file="input/Junk9.java" todir="result" overwrite="true">
+ <target name="testFilter9" depends="setUp">
+ <copy file="input/Junk9.java" todir="${output}" overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="remove" cr="remove" eof="remove" />
</filterchain>
@@ -312,13 +311,13 @@
</target>
<target name="testCannotDoubleEof" depends="test8">
- <fixcrlf file="result/Junk8.java"
+ <fixcrlf file="${output}/Junk8.java"
javafiles="true" tab="add" cr="add" eof="add" />
<assertequal junk="8" />
</target>
<target name="testTabInLiteralInComment">
- <copy file="input/tab_in_literal_in_comment" todir="result"
+ <copy file="input/tab_in_literal_in_comment" todir="${output}"
overwrite="true">
<filterchain>
<fixcrlf javafiles="true" tab="remove" eol="lf" fixlast="false" />
Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/optional/jspc.xml Mon Apr 7 01:53:27 2014
@@ -18,116 +18,116 @@
<project name="jspc-test" default="main" basedir=".">
- <target name="main" depends="testSimple">
- </target>
+ <import file="../../buildfiletest-base.xml"/>
- <target name="init">
- <property name="jsp.dir" location="jsp"/>
- <property name="jsp.output.dir" location="${jsp.dir}/java"/>
- <property name="jsp.verbosity" value="3"/>
- <property name="jsp.compiler" value="jasper41"/>
- <mkdir dir="${jsp.output.dir}"/>
- </target>
-
- <target name="cleanup">
- <delete dir="${jsp.output.dir}"/>
- </target>
-
- <!-- this should fail -->
- <!-- it should not create an output file, but it does, which needs
- cleanup -->
- <target name="testNoTld" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- srcdir="${jsp.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <include
- name="missing_tld.jsp"/>
- </jspc>
- </target>
-
- <!-- this should compile to simple.java -->
- <!-- also, stick to the default compiler here to ensure it still works-->
- <target name="testSimple" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- srcdir="${jsp.dir}"
- verbose="${jsp.verbosity}">
- <include
- name="simple.jsp"/>
- </jspc>
- </target>
-
- <!-- this should compile to uriroot.java -->
- <target name="testUriroot" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- uriroot="${jsp.dir}"
- srcdir="${jsp.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <include
- name="uriroot.jsp"/>
- </jspc>
- </target>
-
- <!-- this should compile an xml format jsp page to xml.java -->
- <target name="testXml" depends="init">
- <jspc
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ <property name="jsp.dir" location="jsp"/>
+ <property name="jsp.output.dir" location="${output}"/>
+ <property name="jsp.verbosity" value="3"/>
+ <property name="jsp.compiler" value="jasper41"/>
+ <mkdir dir="${jsp.output.dir}"/>
+ </target>
+
+ <target name="main" depends="testSimple">
+ </target>
+
+
+ <!-- this should fail -->
+ <!-- it should not create an output file, but it does, which needs
+ cleanup -->
+ <target name="testNoTld" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ srcdir="${jsp.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <include
+ name="missing_tld.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- this should compile to simple.java -->
+ <!-- also, stick to the default compiler here to ensure it still works-->
+ <target name="testSimple" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ srcdir="${jsp.dir}"
+ verbose="${jsp.verbosity}">
+ <include
+ name="simple.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- this should compile to uriroot.java -->
+ <target name="testUriroot" depends="setUp">
+ <jspc
destdir="${jsp.output.dir}"
uriroot="${jsp.dir}"
srcdir="${jsp.dir}"
compiler="${jsp.compiler}"
verbose="${jsp.verbosity}">
- <include name="xml.jsp"/>
- </jspc>
- </target>
-
- <!-- this should compile default.jsp to mangled(%default).java -->
- <target name="testKeyword" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- srcdir="${jsp.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <include
- name="default.jsp"/>
- </jspc>
- </target>
-
- <!-- this should compile default.jsp to mangled(%default).java -->
- <target name="testInvalidClassname" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- srcdir="${jsp.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <include
- name="1nvalid-classname.jsp"/>
- </jspc>
- </target>
-
- <!-- non jsp pages should be ignored -->
- <target name="testNotAJspFile" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- srcdir="${jsp.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <include
- name="wrong_type.txt"/>
- </jspc>
- </target>
-
- <!-- test for webapp compilation -->
- <target name="testWebapp" depends="init">
- <jspc
- destdir="${jsp.output.dir}"
- compiler="${jsp.compiler}"
- verbose="${jsp.verbosity}">
- <webapp basedir="${jsp.dir}" />
- </jspc>
- </target>
-
+ <include
+ name="uriroot.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- this should compile an xml format jsp page to xml.java -->
+ <target name="testXml" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ uriroot="${jsp.dir}"
+ srcdir="${jsp.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <include name="xml.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- this should compile default.jsp to mangled(%default).java -->
+ <target name="testKeyword" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ srcdir="${jsp.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <include
+ name="default.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- this should compile default.jsp to mangled(%default).java -->
+ <target name="testInvalidClassname" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ srcdir="${jsp.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <include
+ name="1nvalid-classname.jsp"/>
+ </jspc>
+ </target>
+
+ <!-- non jsp pages should be ignored -->
+ <target name="testNotAJspFile" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ srcdir="${jsp.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <include
+ name="wrong_type.txt"/>
+ </jspc>
+ </target>
+
+ <!-- test for webapp compilation -->
+ <target name="testWebapp" depends="setUp">
+ <jspc
+ destdir="${jsp.output.dir}"
+ compiler="${jsp.compiler}"
+ verbose="${jsp.verbosity}">
+ <webapp basedir="${jsp.dir}"/>
+ </jspc>
+ </target>
+
</project>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/optional/junit.xml Mon Apr 7 01:53:27 2014
@@ -17,17 +17,18 @@
-->
<project name="junit-test" basedir="." default="outputTests">
+ <import file="../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ </target>
+
<property name="showoutput" value="false" />
<path id="test">
<pathelement path="${java.class.path}" />
<pathelement location="../../../../../build/testcases" />
</path>
- <target name="cleanup">
- <delete file="testlog.txt"/>
- <delete dir="out"/>
- </target>
-
<target name="testForkedOutput">
<junit fork="yes" haltonerror="true" haltonfailure="true"
showoutput="${showoutput}">
@@ -91,11 +92,12 @@
</junit>
</target>
- <target name="capture">
+ <target name="capture" depends="setUp">
<property name="fork" value="false"/>
<junit fork="${fork}">
<test
name="org.apache.tools.ant.taskdefs.optional.junit.Printer"
+ todir="${output}"
outfile="testlog"/>
<formatter type="plain"/>
<classpath refid="test"/>
@@ -112,12 +114,11 @@
</junit>
</target>
- <target name="testBatchTestForkOnceToDir">
- <mkdir dir="out"/>
+ <target name="testBatchTestForkOnceToDir" depends="setUp">
<junit fork="true" forkmode="once">
<formatter type="xml"/>
<classpath refid="test"/>
- <batchtest todir="out">
+ <batchtest todir="${output}">
<fileset dir="../../../../tests/junit">
<include
name="org/apache/tools/ant/taskdefs/optional/junit/*Test.java"/>
@@ -132,11 +133,11 @@
<!-- Bugzilla Report 32973 -->
<target name="testBatchTestForkOnceExtension">
- <mkdir dir="out"/>
+ <mkdir dir="${output}"/>
<junit fork="true" forkmode="once">
<formatter type="xml" extension=".foo"/>
<classpath refid="test"/>
- <batchtest todir="out">
+ <batchtest todir="${output}">
<fileset dir="../../../../tests/junit">
<include
name="org/apache/tools/ant/taskdefs/optional/junit/*Test.java"/>
@@ -150,12 +151,12 @@
</target>
<target name="testBatchTestForkOnceCustomFormatter">
- <mkdir dir="out"/>
+ <mkdir dir="${output}"/>
<junit fork="true" forkmode="once">
<formatter extension="foo"
classname="org.apache.tools.ant.taskdefs.optional.junit.TestFormatter"/>
<classpath refid="test"/>
- <batchtest todir="out">
+ <batchtest todir="${output}">
<fileset dir="../../../../tests/junit">
<include
name="org/apache/tools/ant/taskdefs/optional/junit/*Test.java"/>
@@ -169,7 +170,7 @@
</target>
<target name="failureRecorder.prepare">
- <property name="tmp.dir" value="out"/>
+ <property name="tmp.dir" value="${output}"/>
<mkdir dir="${tmp.dir}/org"/>
<echo file="${tmp.dir}/A.java">
import junit.framework.*;
@@ -210,7 +211,7 @@
</target>
<target name="failureRecorder.internal">
- <property name="tmp.dir" value="out"/>
+ <property name="tmp.dir" value="${output}"/>
<delete>
<fileset dir="${tmp.dir}" includes="FailedTests*.class"/>
</delete>
@@ -248,7 +249,7 @@
</target>
<target name="failureRecorder.fixing">
- <property name="tmp.dir" value="out"/>
+ <property name="tmp.dir" value="${output}"/>
<echo file="${tmp.dir}/A.java">
import junit.framework.*;
public class A extends TestCase {
@@ -278,12 +279,12 @@
<!-- JUnit4 Ignore and Assume for skipping tests -->
<target name="testSkippableTests">
- <mkdir dir="out"/>
+ <mkdir dir="${output}"/>
<junit fork="true">
<classpath refid="test"/>
<formatter type="xml"/>
<classpath refid="test"/>
- <batchtest todir="out">
+ <batchtest todir="${output}">
<fileset dir="../../../../tests/junit">
<include name="org/example/junit/JUnit4Skippable.java"/>
<!-- tests remove out-dir on tearDown -->
@@ -295,12 +296,12 @@
<!-- Skipping classes that are not tests -->
<target name="testNonTests">
- <mkdir dir="out"/>
+ <mkdir dir="${output}"/>
<junit fork="true">
<classpath refid="test"/>
<formatter type="xml"/>
<classpath refid="test"/>
- <batchtest todir="out" skipNonTests="true">
+ <batchtest todir="${output}" skipNonTests="true">
<fileset dir="../../../../tests/junit">
<include name="org/example/junit/*Missed.java"/>
<!-- tests remove out-dir on tearDown -->
@@ -311,12 +312,12 @@
<!-- Not skipping classes that are not tests -->
<target name="testNonTestsRun">
- <mkdir dir="out"/>
+ <mkdir dir="${output}"/>
<junit fork="true">
<classpath refid="test"/>
<formatter type="xml"/>
<classpath refid="test"/>
- <batchtest todir="out" skipNonTests="false">
+ <batchtest todir="${output}" skipNonTests="false">
<fileset dir="../../../../tests/junit">
<include name="org/example/junit/*Missed.java"/>
<!-- tests remove out-dir on tearDown -->
@@ -326,7 +327,7 @@
</target>
<target name="testTestMethods" >
- <property name="tmp.dir" value="out"/>
+ <property name="tmp.dir" value="${output}"/>
<echo file="${tmp.dir}/T1.java">public class T1 extends
junit.framework.TestCase {
public void testOK() {}
Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/optional/junitreport.xml Mon Apr 7 01:53:27 2014
@@ -16,138 +16,139 @@
limitations under the License.
-->
-<project name="junitreport-test" basedir="." default="reports">
+<project name="junitreport-test" basedir="." default="reports1">
- <property name="jrdir" location="junitreport"/>
- <property name="outputdir" location="${jrdir}/test"/>
+ <import file="../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ </target>
+
+
+ <property name="jrdir" location="junitreport"/>
<!-- reports1 take care of transformation of 2 test result files and
produce reports according to the default format (frames)
needed for testNoFileJUnitNoFrames -->
<target name="reports1">
- <mkdir dir="${outputdir}"/>
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testEmptyFile">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="ZEROBYTES-*.xml"/>
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testIncompleteFile">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="INCOMPLETE-*.xml"/>
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testWrongElement">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="WRONGELEMENT-*.xml"/>
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testNamespace">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="NAMESPACE-*.xml"/>
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
- <target name="clean">
- <delete dir="${outputdir}"/>
- </target>
-
<target name="testStackTraceLineBreaks">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testSpecialSignsInSrcPath">
- <mkdir dir="${outputdir}/html"/>
- <mkdir dir="${outputdir}/test# $$%§&-!cases"/>
- <copy todir="${outputdir}/test# $$%§&-!cases">
+ <mkdir dir="${output}/html"/>
+ <mkdir dir="${output}/test# $$%§&-!cases"/>
+ <copy todir="${output}/test# $$%§&-!cases">
<fileset dir="junitreport" includes="TEST-*.xml"/>
</copy>
- <junitreport todir="${outputdir}/html">
- <fileset dir="${outputdir}/test# $$%§&-!cases">
+ <junitreport todir="${output}/html">
+ <fileset dir="${output}/test# $$%§&-!cases">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testSpecialSignsInHtmlPath">
- <mkdir dir="${outputdir}/html# $$%§&-!report"/>
- <mkdir dir="${outputdir}/test"/>
- <copy todir="${outputdir}/test">
+ <mkdir dir="${output}/html# $$%§&-!report"/>
+ <mkdir dir="${output}/test"/>
+ <copy todir="${output}/test">
<fileset dir="junitreport" includes="TEST-*.xml"/>
</copy>
- <junitreport todir="${outputdir}/html# $$%§&-!report">
- <fileset dir="${outputdir}/test">
+ <junitreport todir="${output}/html# $$%§&-!report">
+ <fileset dir="${output}/test">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html# $$%§&-!report"/>
+ <report todir="${output}/html# $$%§&-!report"/>
</junitreport>
</target>
<target name="testWithStyleFromClasspath">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"/>
+ <report todir="${output}/html"/>
</junitreport>
</target>
<target name="testNoFrames">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html" format="noframes"/>
+ <report todir="${output}/html" format="noframes"/>
</junitreport>
</target>
<target name="testWithStyleFromDir">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"
+ <report todir="${output}/html"
styledir="junitreport"
format="frames"/>
</junitreport>
@@ -155,24 +156,24 @@
<!-- bug report 40022 -->
<target name="testWithStyleFromDirAndXslImport">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"
+ <report todir="${output}/html"
styledir="junitreport-with-include"
format="frames"/>
</junitreport>
</target>
<target name="testWithParams">
- <mkdir dir="${outputdir}/html"/>
- <junitreport todir="${outputdir}">
+ <mkdir dir="${output}/html"/>
+ <junitreport todir="${output}">
<fileset dir="${jrdir}">
<include name="TEST-*.xml"/>
</fileset>
- <report todir="${outputdir}/html"
+ <report todir="${output}/html"
styledir="junitreport"
format="frames">
<param name="key1" expression="value1"/>
@@ -180,7 +181,7 @@
</report>
</junitreport>
<concat>
- <fileset file="${outputdir}/html/index.html"/>
+ <fileset file="${output}/html/index.html"/>
</concat>
</target>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/optional/propertyfile.xml Mon Apr 7 01:53:27 2014
@@ -18,7 +18,13 @@
<project name="propertyfile-test" default="main" basedir=".">
- <property file="propertyfile.build.properties"/>
+ <import file="../../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ </target>
+
+ <property file="${output}/propertyfile.build.properties"/>
<target name="main">
<fail>
@@ -29,7 +35,7 @@
<target name="update-existing-properties">
<propertyfile
- file="${test.propertyfile}"
+ file="${output}/${test.propertyfile}"
comment="unit test for the property file task..." >
<entry key="firstname" value="${firstname}" />
<entry key="lastname" value="${lastname}" />
@@ -43,14 +49,14 @@
<target name="delete-properties">
<echoproperties/>
<propertyfile
- file="${test.propertyfile}"
+ file="${output}/${test.propertyfile}"
comment="unit test for the property file task..." >
<entry key="firstname" operation="del" />
</propertyfile>
</target>
<target name="exercise">
- <propertyfile file="${test.propertyfile}">
+ <propertyfile file="${output}/${test.propertyfile}">
<entry key="existing.prop"
type="int"
default="23"/>
@@ -91,11 +97,11 @@
value="8"
pattern="MMdd"/>
</propertyfile>
- <property file="${test.propertyfile}"/>
+ <property file="${output}/${test.propertyfile}"/>
</target>
<target name="createfile">
- <echo file="${overwrite.test.propertyfile}">
+ <echo file="${output}/${overwrite.test.propertyfile}">
foo=3
</echo>
</target>
@@ -103,11 +109,11 @@
<target name="bugDemo1" depends="createfile,bugDemoInit"/>
<target name="bugDemo2" depends="bugDemoInit">
- <property file="${overwrite.test.propertyfile}"/>
+ <property file="${output}/${overwrite.test.propertyfile}"/>
</target>
<target name="bugDemoInit">
- <propertyfile file="${overwrite.test.propertyfile}">
+ <propertyfile file="${output}/${overwrite.test.propertyfile}">
<entry key="foo" default="0" value="1" operation="+" type="int"/>
</propertyfile>
</target>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/property.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/property.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/property.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/property.xml Mon Apr 7 01:53:27 2014
@@ -18,13 +18,14 @@
<project name="property-test" basedir="." default="test1">
- <property name="tmp.dir" value="_tmpdir_"/>
- <available property="java5+" classname="java.lang.Iterable"/>
+ <import file="../buildfiletest-base.xml"/>
- <target name="tearDown">
- <delete dir="${tmp.dir}"/>
+ <target name="setUp">
+ <mkdir dir="${output}" />
</target>
+ <available property="java5+" classname="java.lang.Iterable"/>
+
<target name="test1">
<property environment="testenv"/>
</target>
@@ -70,8 +71,7 @@
</target>
<target name="genXmlPropFile">
- <mkdir dir="${tmp.dir}"/>
- <echo file="${tmp.dir}/props.xml"><?xml version="1.0" encoding="UTF-8"?>
+ <echo file="${output}/props.xml"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties version="1.0">
<comment>
@@ -85,7 +85,7 @@
</target>
<target name="testXmlProperty.internal" depends="genXmlPropFile" if="java5+">
- <property file="${tmp.dir}/props.xml"/>
+ <property file="${output}/props.xml"/>
</target>
<target name="testXmlProperty" depends="testXmlProperty.internal"/>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/recorder.xml Mon Apr 7 01:53:27 2014
@@ -17,60 +17,57 @@
-->
<project name="recorder-test" default="all" basedir=".">
- <property name="recin" location="recorder"/>
- <property name="recdir" location="recorder-out"/>
+ <import file="../buildfiletest-base.xml"/>
- <target name="all" depends="noappend,append,restart,deleterestart"/>
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ </target>
+
+ <property name="recin" location="recorder"/>
+
+ <target name="all" depends="noappend,append,restart,deleterestart"/>
+
+ <target name="noappend">
+ <copy file="${recin}/rectest2.result" tofile="${output}/rectest1.log"/>
+ <record name="${output}/rectest1.log" action="start"/>
+ <echo message="some message1"/>
+ <record name="${output}/rectest1.log" action="stop"/>
+ </target>
+
+ <target name="append">
+ <copy file="${recin}/rectest1.result" tofile="${output}/rectest2.log"/>
+ <record name="${output}/rectest2.log" append="true" action="start"/>
+ <echo message="some message2"/>
+ <record name="${output}/rectest2.log" action="stop"/>
+ </target>
+
+ <target name="restart">
+ <record name="${output}/rectest3.log" action="start"/>
+ <echo message="some message1"/>
+ <record name="${output}/rectest3.log" action="stop"/>
+ <echo message="some message2"/>
+ <record name="${output}/rectest3.log" action="start"/>
+ <echo message="some message3"/>
+ <record name="${output}/rectest3.log" action="stop"/>
+ </target>
+
+ <target name="deleterestart">
+ <record name="${output}/rectest4.log" action="start"/>
+ <echo message="some message1"/>
+ <record name="${output}/rectest4.log" action="stop"/>
+ <delete file="${output}/rectest4.log"/>
+ <echo message="some message2"/>
+ <record name="${output}/rectest4.log" action="start"/>
+ <echo message="some message3"/>
+ <record name="${output}/rectest4.log" action="stop"/>
+ </target>
+
+ <target name="subbuild">
+ <record name="${output}/rectest5.log" action="start"/>
+ <echo message="some message5"/>
+ <ant antfile="recorder2.xml"/>
+ <record name="${output}/rectest5.log" action="stop"/>
+ </target>
- <target name="prepare">
- <mkdir dir="${recdir}"/>
- </target>
-
- <target name="noappend">
- <copy file="${recin}/rectest2.result" tofile="${recdir}/rectest1.log"/>
- <record name="${recdir}/rectest1.log" action="start" />
- <echo message="some message1"/>
- <record name="${recdir}/rectest1.log" action="stop" />
- </target>
-
- <target name="append">
- <copy file="${recin}/rectest1.result" tofile="${recdir}/rectest2.log"/>
- <record name="${recdir}/rectest2.log" append="true" action="start"/>
- <echo message="some message2"/>
- <record name="${recdir}/rectest2.log" action="stop"/>
- </target>
-
- <target name="restart">
- <record name="${recdir}/rectest3.log" action="start"/>
- <echo message="some message1"/>
- <record name="${recdir}/rectest3.log" action="stop"/>
- <echo message="some message2"/>
- <record name="${recdir}/rectest3.log" action="start"/>
- <echo message="some message3"/>
- <record name="${recdir}/rectest3.log" action="stop"/>
- </target>
-
- <target name="deleterestart">
- <record name="${recdir}/rectest4.log" action="start"/>
- <echo message="some message1"/>
- <record name="${recdir}/rectest4.log" action="stop"/>
- <delete file="${recdir}/rectest4.log"/>
- <echo message="some message2"/>
- <record name="${recdir}/rectest4.log" action="start"/>
- <echo message="some message3"/>
- <record name="${recdir}/rectest4.log" action="stop"/>
- </target>
-
- <target name="subbuild">
- <record name="${recdir}/rectest5.log" action="start"/>
- <echo message="some message5"/>
- <ant antfile="recorder2.xml"/>
- <record name="${recdir}/rectest5.log" action="stop"/>
- </target>
-
-
- <target name="cleanup">
- <delete dir="${recdir}"/>
- </target>
</project>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/recorder2.xml Mon Apr 7 01:53:27 2014
@@ -17,16 +17,13 @@
-->
<project name="recorder-test" default="test6" basedir=".">
- <property name="recin" location="recorder"/>
- <property name="recdir" location="recorder-out"/>
-
<target name="test6">
- <record name="${recdir}/rectest6.log" action="start" />
+ <record name="${output}/rectest6.log" action="start" />
<echo message="some message6"/>
- <record name="${recdir}/rectest5.log" action="stop" />
+ <record name="${output}/rectest5.log" action="stop" />
<echo message="some message7"/>
- <record name="${recdir}/rectest5.log" action="start" />
+ <record name="${output}/rectest5.log" action="start" />
<echo message="some message8"/>
- <record name="${recdir}/rectest6.log" action="stop" />
+ <record name="${output}/rectest6.log" action="stop" />
</target>
</project>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/replace.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/replace.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/replace.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/replace.xml Mon Apr 7 01:53:27 2014
@@ -18,7 +18,12 @@
<project name="xxx-test" basedir="." default="test1">
- <property name="tmp.dir" location="replace/tmp"/>
+ <import file="../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}"/>
+ </target>
+
<target name="test1">
<replace/>
@@ -64,29 +69,26 @@
<!-- of the replacement tokens and values to the platform default -->
<!-- in certain cases (checkout done with cvs of cygwin, the line endings of the various files do not match-->
<!-- the system property line.separator -->
- <copy file="replace/source.txt" tofile="${tmp.dir}/output.txt"/>
- <copy file="replace/value.txt" tofile="${tmp.dir}/value.txt" />
- <copy file="replace/result.txt" tofile="${tmp.dir}/result.txt" />
- <fixcrlf srcdir="${tmp.dir}" includes="*.txt"/>
+ <copy file="replace/source.txt" tofile="${output}/output.txt"/>
+ <copy file="replace/value.txt" tofile="${output}/value.txt" />
+ <copy file="replace/result.txt" tofile="${output}/result.txt" />
+ <fixcrlf srcdir="${output}" includes="*.txt"/>
</target>
<target name="test9" depends="test9-setup">
- <loadfile srcFile="${tmp.dir}/value.txt" property="content"/>
- <replace file="${tmp.dir}/output.txt" token="@@@Replace this@@@" value="${content}"/>
+ <loadfile srcFile="${output}/value.txt" property="content"/>
+ <replace file="${output}/output.txt" token="@@@Replace this@@@" value="${content}"/>
</target>
<target name="lastModifiedSetup">
- <mkdir dir="${tmp.dir}"/>
- <echo file="${tmp.dir}/test.txt">Hello, world!</echo>
+ <mkdir dir="${output}"/>
+ <echo file="${output}/test.txt">Hello, world!</echo>
</target>
<target name="testNoPreserve">
- <replace token="world" value="Ant" file="${tmp.dir}/test.txt"/>
+ <replace token="world" value="Ant" file="${output}/test.txt"/>
</target>
<target name="testPreserve">
- <replace token="world" value="Ant" file="${tmp.dir}/test.txt"
+ <replace token="world" value="Ant" file="${output}/test.txt"
preserveLastModified="true"/>
</target>
- <target name="cleanup">
- <delete dir="${tmp.dir}" quiet="true"/>
- </target>
</project>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/signjar.xml Mon Apr 7 01:53:27 2014
@@ -17,11 +17,16 @@
-->
<project name="signjartest" default="help" basedir="..">
- <property name="classes.dir" value="../../../build/classes"/>
- <property name="sign.dir" location="signedjars" />
- <property name="subdir" location="${sign.dir}/subdir" />
- <property name="test.jar" location="${sign.dir}/signtest.jar" />
- <property name="subdirtest.jar" location="${subdir}/signtest.jar" />
+ <import file="../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ <property name="subdir" location="${output}/subdir" />
+ <property name="classes.dir" value="../../../build/classes"/>
+ <property name="test.jar" location="${output}/signtest.jar" />
+ <property name="subdirtest.jar" location="${subdir}/signtest.jar" />
+
+ </target>
<macrodef name="assertSigned">
@@ -45,27 +50,14 @@
storepass="apacheant"/>
</presetdef>
-
-
<presetdef name="sign">
<sign-base jar="${test.jar}" />
</presetdef>
- <target name="init">
- <mkdir dir="${sign.dir}" />
- <mkdir dir="${subdir}" />
- </target>
-
- <target name="jar" depends="init">
+ <target name="jar" depends="setUp">
<jar jarfile="${test.jar}" basedir="${classes.dir}" includes="**/Task.class"/>
</target>
-
-
- <target name="clean">
- <delete dir="${sign.dir}"/>
- </target>
-
<target name="help">
<echo>This build is for use with Ant's test cases</echo>
</target>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/sync.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/sync.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/sync.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/sync.xml Mon Apr 7 01:53:27 2014
@@ -16,24 +16,21 @@
limitations under the License.
-->
<project name="sync-test" default="not-me">
- <property name="scratch" location="synctest"/>
+ <import file="../buildfiletest-base.xml"/>
- <target name="not-me">
- <fail>This file must be used from a test case</fail>
- </target>
-
- <target name="cleanup">
- <delete dir="${scratch}"/>
- </target>
-
- <target name="setup">
- <property name="src" location="${scratch}/source"/>
- <property name="dest" location="${scratch}/target"/>
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ <property name="src" location="${output}/source"/>
+ <property name="dest" location="${output}/target"/>
<mkdir dir="${src}"/>
<mkdir dir="${dest}"/>
</target>
- <target name="simplecopy" depends="setup">
+ <target name="not-me">
+ <fail>This file must be used from a test case</fail>
+ </target>
+
+ <target name="simplecopy" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<sync todir="${dest}">
@@ -41,7 +38,7 @@
</sync>
</target>
- <target name="copyandremove" depends="setup">
+ <target name="copyandremove" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
@@ -51,7 +48,7 @@
</sync>
</target>
- <target name="copyandremove-with-filelist" depends="setup">
+ <target name="copyandremove-with-filelist" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
@@ -64,7 +61,7 @@
</sync>
</target>
- <target name="copyandremove-with-zipfileset" depends="setup">
+ <target name="copyandremove-with-zipfileset" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
@@ -77,7 +74,7 @@
</sync>
</target>
- <target name="copyandremove-emptypreserve" depends="setup">
+ <target name="copyandremove-emptypreserve" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
@@ -88,7 +85,7 @@
</sync>
</target>
- <target name="emptycopy" depends="setup">
+ <target name="emptycopy" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<sync todir="${dest}">
@@ -96,7 +93,7 @@
</sync>
</target>
- <target name="emptydircopy" depends="setup">
+ <target name="emptydircopy" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<sync todir="${dest}"
@@ -105,7 +102,7 @@
</sync>
</target>
- <target name="emptydircopyandremove" depends="setup">
+ <target name="emptydircopyandremove" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e/f"/>
@@ -115,7 +112,7 @@
</sync>
</target>
- <target name="copynoremove" depends="setup">
+ <target name="copynoremove" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
@@ -128,7 +125,7 @@
</sync>
</target>
- <target name="copynoremove-selectors" depends="setup">
+ <target name="copynoremove-selectors" depends="setUp">
<mkdir dir="${src}/a/b/c"/>
<touch file="${src}/a/b/c/d"/>
<mkdir dir="${dest}/e"/>
Modified: ant/core/trunk/src/etc/testcases/taskdefs/war.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/war.xml?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/war.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/war.xml Mon Apr 7 01:53:27 2014
@@ -17,25 +17,23 @@
-->
<project name="war-test" basedir="." default="help">
- <property name="working.dir" value="working"/>
+ <import file="../buildfiletest-base.xml"/>
+
+ <target name="setUp">
+ <mkdir dir="${output}" />
+ </target>
+
<target name="help">
<echo message="Test file for the war task"/>
</target>
- <target name="setup">
- <mkdir dir="${working.dir}"/>
- </target>
-
- <target name="testlibrefs" depends="setup">
+ <target name="testlibrefs" depends="setUp">
<fileset id="test" dir="." includes="war.xml"/>
- <war webxml="war.xml" destfile="${working.dir}/test.war">
+ <war webxml="war.xml" destfile="${output}/test.war">
<lib refid="test"/>
</war>
- <unzip src="${working.dir}/test.war" dest="${working.dir}"/>
+ <unzip src="${output}/test.war" dest="${output}"/>
</target>
- <target name="clean">
- <delete dir="${working.dir}"/>
- </target>
</project>
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java Mon Apr 7 01:53:27 2014
@@ -52,20 +52,13 @@ public class ExecTaskTest extends BuildF
configureProject(BUILD_FILE);
}
- public void tearDown() {
- if (logFile != null && logFile.exists()) {
- getProject().setProperty("logFile", logFile.getAbsolutePath());
- }
- executeTarget("cleanup");
- }
-
public void testspawn() {
- project.executeTarget("init");
+ project.executeTarget("setUp");
if (project.getProperty("test.can.run") == null) {
return;
}
myBuild = new MonitoredBuild(new File(System.getProperty("root"), BUILD_FILE), "spawn");
- logFile = FILE_UTILS.createTempFile("spawn", "log", project.getBaseDir(), false, false);
+ logFile = FILE_UTILS.createTempFile("spawn", "log", getOutputDir(), false, false);
// this is guaranteed by FileUtils#createTempFile
assertTrue("log file not existing", !logFile.exists());
// make the spawned process run 4 seconds
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/FixCrLfTest.java Mon Apr 7 01:53:27 2014
@@ -40,10 +40,6 @@ public class FixCrLfTest extends BuildFi
configureProject("src/etc/testcases/taskdefs/fixcrlf/build.xml");
}
- public void tearDown() {
- executeTarget("cleanup");
- }
-
public void test1() throws IOException {
executeTarget("test1");
}
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/PropertyTest.java Mon Apr 7 01:53:27 2014
@@ -35,6 +35,7 @@ public class PropertyTest extends BuildF
public void setUp() {
configureProject("src/etc/testcases/taskdefs/property.xml");
+ project.executeTarget("setUp");
}
public void test1() {
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RecorderTest.java Mon Apr 7 01:53:27 2014
@@ -21,6 +21,7 @@ package org.apache.tools.ant.taskdefs;
import org.apache.tools.ant.BuildFileTest;
import org.apache.tools.ant.util.FileUtils;
+import java.io.File;
import java.io.IOException;
/**
@@ -39,11 +40,7 @@ public class RecorderTest extends BuildF
public void setUp() {
configureProject("src/etc/testcases/taskdefs/recorder.xml");
- executeTarget("prepare");
- }
-
- public void tearDown() {
- executeTarget("cleanup");
+ executeTarget("setUp");
}
public void testNoAppend() throws IOException {
@@ -51,8 +48,8 @@ public class RecorderTest extends BuildF
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest1.result"),
- project.resolveFile(REC_DIR
- + "rectest1.log"), true));
+ new File(getOutputDir(),
+ "rectest1.log"), true));
}
public void testAppend() throws IOException {
@@ -60,8 +57,8 @@ public class RecorderTest extends BuildF
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest2.result"),
- project.resolveFile(REC_DIR
- + "rectest2.log"), true));
+ new File(getOutputDir(),
+ "rectest2.log"), true));
}
public void testRestart() throws IOException {
@@ -69,8 +66,7 @@ public class RecorderTest extends BuildF
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest3.result"),
- project.resolveFile(REC_DIR
- + "rectest3.log"), true));
+ new File(getOutputDir(), "rectest3.log"), true));
}
public void testDeleteRestart() throws IOException {
@@ -78,8 +74,8 @@ public class RecorderTest extends BuildF
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest4.result"),
- project.resolveFile(REC_DIR
- + "rectest4.log"), true));
+ new File(getOutputDir(),
+ "rectest4.log"), true));
}
public void testSubBuild() throws IOException {
@@ -87,13 +83,11 @@ public class RecorderTest extends BuildF
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest5.result"),
- project.resolveFile(REC_DIR
- + "rectest5.log"), true));
+ new File(getOutputDir(), "rectest5.log"), true));
assertTrue(FILE_UTILS
.contentEquals(project.resolveFile(REC_IN
+ "rectest6.result"),
- project.resolveFile(REC_DIR
- + "rectest6.log"), true));
+ new File(getOutputDir(), "rectest6.log"), true));
}
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ReplaceTest.java Mon Apr 7 01:53:27 2014
@@ -34,6 +34,7 @@ public class ReplaceTest extends BuildFi
public void setUp() {
configureProject("src/etc/testcases/taskdefs/replace.xml");
+ project.executeTarget("setUp");
}
public void test1() {
@@ -70,32 +71,26 @@ public class ReplaceTest extends BuildFi
public void test9() throws IOException {
executeTarget("test9");
- String tmpdir = project.getProperty("tmp.dir");
- assertEqualContent(new File(tmpdir, "result.txt"),
- new File(tmpdir, "output.txt"));
+ assertEqualContent(new File(getOutputDir(), "result.txt"),
+ new File(getOutputDir(), "output.txt"));
}
public void testNoPreserveLastModified() throws Exception {
executeTarget("lastModifiedSetup");
- String tmpdir = project.getProperty("tmp.dir");
- long ts1 = new File(tmpdir, "test.txt").lastModified();
+ long ts1 = new File(getOutputDir(), "test.txt").lastModified();
Thread.sleep(3000);
executeTarget("testNoPreserve");
- assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified());
+ assertTrue(ts1 < new File(getOutputDir(), "test.txt").lastModified());
}
public void testPreserveLastModified() throws Exception {
executeTarget("lastModifiedSetup");
- String tmpdir = project.getProperty("tmp.dir");
- long ts1 = new File(tmpdir, "test.txt").lastModified();
+ long ts1 = new File(getOutputDir(), "test.txt").lastModified();
Thread.sleep(3000);
executeTarget("testPreserve");
- assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified());
+ assertTrue(ts1 == new File(getOutputDir(), "test.txt").lastModified());
}
- public void tearDown() {
- executeTarget("cleanup");
- }
public void assertEqualContent(File expect, File result)
throws AssertionFailedError, IOException {
if (!result.exists()) {
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java Mon Apr 7 01:53:27 2014
@@ -40,10 +40,6 @@ public class SignJarTest extends BuildFi
configureProject("src/etc/testcases/taskdefs/signjar.xml");
}
- public void tearDown() {
- executeTarget("clean");
- }
-
/**
* check for being offline
* @return true if the system property "offline" is "true"
@@ -108,7 +104,7 @@ public class SignJarTest extends BuildFi
}
/**
- * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=50081
+ * @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=50081">bug 50081</a>
*/
public void testSignUnnormalizedJar() throws Exception {
executeTarget("jar");
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java Mon Apr 7 01:53:27 2014
@@ -30,10 +30,6 @@ public class SyncTest extends BuildFileT
configureProject("src/etc/testcases/taskdefs/sync.xml");
}
- public void tearDown() {
- executeTarget("cleanup");
- }
-
public void testSimpleCopy() {
executeTarget("simplecopy");
String d = getProject().getProperty("dest") + "/a/b/c/d";
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/WarTest.java Mon Apr 7 01:53:27 2014
@@ -38,16 +38,12 @@ public class WarTest extends BuildFileTe
configureProject(TEST_BUILD_FILE);
}
- public void tearDown() {
- executeTarget("clean");
- }
-
/**
* Test direct dependency removal
*/
public void testLibRefs() {
executeTarget("testlibrefs");
- File f = getProject().resolveFile("working/WEB-INF/lib/war.xml");
+ File f = new File(getOutputDir(), "WEB-INF/lib/war.xml");
assertTrue("File has been put into lib", f.exists());
}
}
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java Mon Apr 7 01:53:27 2014
@@ -33,14 +33,6 @@ import org.apache.tools.ant.taskdefs.opt
* @since Ant 1.5
*/
public class JspcTest extends BuildFileTest {
- /**
- * Description of the Field
- */
- private File baseDir;
- /**
- * Description of the Field
- */
- private File outDir;
/**
* Description of the Field
@@ -63,16 +55,6 @@ public class JspcTest extends BuildFileT
*/
public void setUp() {
configureProject(TASKDEFS_DIR + "jspc.xml");
- baseDir = new File(System.getProperty("root"), TASKDEFS_DIR);
- outDir = new File(baseDir, "jsp/java");
- }
-
-
- /**
- * The teardown method for JUnit
- */
- public void tearDown() {
- executeTarget("cleanup");
}
@@ -180,7 +162,7 @@ public class JspcTest extends BuildFileT
* @return The OutputFile value
*/
protected File getOutputFile(String subpath) {
- return new File(outDir, subpath);
+ return new File(getOutputDir(), subpath);
}
/**
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PropertyFileTest.java Mon Apr 7 01:53:27 2014
@@ -43,7 +43,8 @@ public class PropertyFileTest extends Bu
* The JUnit setup method
*/
public void setUp() throws Exception {
- destroyTempFiles();
+ configureProject(projectFilePath);
+ executeTarget("setUp");
initTestPropFile();
initBuildPropFile();
configureProject(projectFilePath);
@@ -51,13 +52,6 @@ public class PropertyFileTest extends Bu
}
- /**
- * The JUnit tearDown method
- */
- public void tearDown() {
- destroyTempFiles();
- }
-
public void testNonExistingFile() {
PropertyFile props = new PropertyFile();
props.setProject( getProject() );
@@ -129,33 +123,10 @@ public class PropertyFileTest extends Bu
executeTarget("bugDemo2");
assertEquals("5", project.getProperty("foo"));
}
-/*
- public void testDirect() throws Exception {
- PropertyFile pf = new PropertyFile();
- pf.setProject(project);
- pf.setFile(new File(System.getProperty("root"), testPropsFilePath));
- PropertyFile.Entry entry = pf.createEntry();
-
- entry.setKey("date");
- entry.setValue("123");
- PropertyFile.Entry.Type type = new PropertyFile.Entry.Type();
- type.setValue("date");
- entry.setType(type);
-
- entry.setPattern("yyyy/MM/dd");
-
- PropertyFile.Entry.Operation operation = new PropertyFile.Entry.Operation();
- operation.setValue("+");
- pf.execute();
-
- Properties props = getTestProperties();
- assertEquals("yeehaw", props.getProperty("date"));
- }
-*/
private Properties getTestProperties() throws Exception {
Properties testProps = new Properties();
- FileInputStream propsFile = new FileInputStream(new File(System.getProperty("root"), testPropsFilePath));
+ FileInputStream propsFile = new FileInputStream(new File(getOutputDir(), testPropsFilePath));
testProps.load(propsFile);
propsFile.close();
return testProps;
@@ -169,7 +140,7 @@ public class PropertyFileTest extends Bu
testProps.put(EMAIL_KEY, EMAIL);
testProps.put("existing.prop", "37");
- FileOutputStream fos = new FileOutputStream(new File(System.getProperty("root"), testPropsFilePath));
+ FileOutputStream fos = new FileOutputStream(new File(getOutputDir(), testPropsFilePath));
testProps.store(fos, "defaults");
fos.close();
}
@@ -185,26 +156,12 @@ public class PropertyFileTest extends Bu
buildProps.put(AGE_KEY, NEW_AGE);
buildProps.put(DATE_KEY, NEW_DATE);
- FileOutputStream fos = new FileOutputStream(new File(System.getProperty("root"), buildPropsFilePath));
+ FileOutputStream fos = new FileOutputStream(new File(getOutputDir(), buildPropsFilePath));
buildProps.store(fos, null);
fos.close();
}
- private void destroyTempFiles() {
- File tempFile = new File(System.getProperty("root"), testPropsFilePath);
- tempFile.delete();
- tempFile = null;
-
- tempFile = new File(System.getProperty("root"), buildPropsFilePath);
- tempFile.delete();
- tempFile = null;
-
- tempFile = new File(System.getProperty("root"), valueDoesNotGetOverwrittenPropsFilePath);
- tempFile.delete();
- tempFile = null;
- }
-
private static final String
@@ -212,13 +169,13 @@ public class PropertyFileTest extends Bu
testPropertyFile = "propertyfile.test.properties",
testPropertyFileKey = "test.propertyfile",
- testPropsFilePath = "src/etc/testcases/taskdefs/optional/" + testPropertyFile,
+ testPropsFilePath = testPropertyFile,
valueDoesNotGetOverwrittenPropertyFile = "overwrite.test.properties",
valueDoesNotGetOverwrittenPropertyFileKey = "overwrite.test.propertyfile",
- valueDoesNotGetOverwrittenPropsFilePath = "src/etc/testcases/taskdefs/optional/" + valueDoesNotGetOverwrittenPropertyFile,
+ valueDoesNotGetOverwrittenPropsFilePath = valueDoesNotGetOverwrittenPropertyFile,
- buildPropsFilePath = "src/etc/testcases/taskdefs/optional/propertyfile.build.properties",
+ buildPropsFilePath = "propertyfile.build.properties",
FNAME = "Bruce",
NEW_FNAME = "Clark",
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java?rev=1585372&r1=1585371&r2=1585372&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java Mon Apr 7 01:53:27 2014
@@ -40,10 +40,6 @@ public class JUnitReportTest extends Bui
configureProject("src/etc/testcases/taskdefs/optional/junitreport.xml");
}
- protected void tearDown() {
- executeTarget("clean");
- }
-
/**
* Verifies that no empty junit-noframes.html is generated when frames
* output is selected via the default.
@@ -51,15 +47,14 @@ public class JUnitReportTest extends Bui
*/
public void testNoFileJUnitNoFrames() {
executeTarget("reports1");
- if (new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html").exists())
+ if (new File(getOutputDir(), "html/junit-noframes.html").exists())
{
fail("No file junit-noframes.html expected");
}
}
public void assertIndexCreated() {
- if (!new File(System.getProperty("root"),
- "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html").exists()) {
+ if (!new File(getOutputDir(), "html/index.html").exists()) {
fail("No file index file found");
}
@@ -98,8 +93,7 @@ public class JUnitReportTest extends Bui
expectReportWithText("testStackTraceLineBreaks", null);
FileReader r = null;
try {
- r = new FileReader(new File(System.getProperty("root"),
- "src/etc/testcases/taskdefs/optional/junitreport/test/html/sampleproject/coins/0_CoinTest.html"));
+ r = new FileReader(new File(getOutputDir(), "html/sampleproject/coins/0_CoinTest.html"));
String report = FileUtils.readFully(r);
assertTrue("output must contain <br>:\n" + report,
report.indexOf("junit.framework.AssertionFailedError: DOEG<br>")
@@ -116,7 +110,7 @@ public class JUnitReportTest extends Bui
// Bugzilla Report 38477
public void testSpecialSignsInSrcPath() throws Exception {
executeTarget("testSpecialSignsInSrcPath");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
+ File reportFile = new File(getOutputDir(), "html/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -129,7 +123,7 @@ public class JUnitReportTest extends Bui
public void testSpecialSignsInHtmlPath() throws Exception {
executeTarget("testSpecialSignsInHtmlPath");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html");
+ File reportFile = new File(getOutputDir(), "html# $%\u00A7&-!report/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -143,7 +137,7 @@ public class JUnitReportTest extends Bui
//Bugzilla Report 39708
public void testWithStyleFromDir() throws Exception {
executeTarget("testWithStyleFromDir");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
+ File reportFile = new File(getOutputDir(), "html/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -157,7 +151,7 @@ public class JUnitReportTest extends Bui
//Bugzilla Report 40021
public void testNoFrames() throws Exception {
executeTarget("testNoFrames");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html");
+ File reportFile = new File(getOutputDir(), "html/junit-noframes.html");
// tests one the file object
assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -170,7 +164,7 @@ public class JUnitReportTest extends Bui
//Bugzilla Report 39708
public void testWithStyleFromDirAndXslImport() throws Exception {
executeTarget("testWithStyleFromDirAndXslImport");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
+ File reportFile = new File(getOutputDir(), "html/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -183,7 +177,7 @@ public class JUnitReportTest extends Bui
public void testWithStyleFromClasspath() throws Exception {
executeTarget("testWithStyleFromClasspath");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
+ File reportFile = new File(getOutputDir(), "html/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );
@@ -196,7 +190,7 @@ public class JUnitReportTest extends Bui
public void testWithParams() throws Exception {
expectLogContaining("testWithParams", "key1=value1,key2=value2");
- File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
+ File reportFile = new File(getOutputDir(), "html/index.html");
// tests one the file object
assertTrue("No index.html present. Not generated?", reportFile.exists() );
assertTrue("Cant read the report file.", reportFile.canRead() );