Browse Source

don't put test files into the source tree

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@789284 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
50f09a9b54
1 changed files with 101 additions and 106 deletions
  1. +101
    -106
      src/tests/antunit/taskdefs/exec/apply-test.xml

+ 101
- 106
src/tests/antunit/taskdefs/exec/apply-test.xml View File

@@ -15,7 +15,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<project name="apply-test" xmlns:au="antlib:org.apache.ant.antunit">
<project name="apply-test" default="antunit"
xmlns:au="antlib:org.apache.ant.antunit">
<import file="../../antunit-base.xml" />

<property environment="env" /> <property environment="env" />
<!-- UNIX --> <!-- UNIX -->
<available file="sh" filepath="${env.PATH}" property="sh.executable" /> <available file="sh" filepath="${env.PATH}" property="sh.executable" />
@@ -83,14 +86,16 @@
</macrodef> </macrodef>


<target name="xyz"> <target name="xyz">
<echo file="x">s/x/blah/g${eol}</echo>
<echo file="y">s/y/blah/g${eol}</echo>
<echo file="z">s/z/blah/g${eol}</echo>
<fileset id="xyz" dir="${basedir}" includes="x,y,z" />
<filelist id="xyzlist" dir="${basedir}" files="x,y,z" />
<property name="x" location="x" />
<property name="y" location="y" />
<property name="z" location="z" />
<mkdir dir="${input}"/>
<mkdir dir="${output}"/>
<echo file="${input}/x">s/x/blah/g${eol}</echo>
<echo file="${input}/y">s/y/blah/g${eol}</echo>
<echo file="${input}/z">s/z/blah/g${eol}</echo>
<fileset id="xyz" dir="${input}" includes="x,y,z" />
<filelist id="xyzlist" dir="${input}" files="x,y,z" />
<property name="x" location="${input}/x" />
<property name="y" location="${input}/y" />
<property name="z" location="${input}/z" />
</target> </target>


<target name="testNoRedirect" depends="xyz" if="test.can.run"> <target name="testNoRedirect" depends="xyz" if="test.can.run">
@@ -120,7 +125,7 @@
</target> </target>


<target name="testRedirect1" depends="xyz" if="test.can.run"> <target name="testRedirect1" depends="xyz" if="test.can.run">
<apply executable="sh" output="redirect.out" append="true">
<apply executable="sh" output="${output}/redirect.out" append="true">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>
@@ -128,7 +133,7 @@
<au:assertTrue> <au:assertTrue>
<resourcecount count="1"> <resourcecount count="1">
<restrict id="results"> <restrict id="results">
<file file="redirect.out" />
<file file="${output}/redirect.out" />
<and xmlns="antlib:org.apache.tools.ant.types.resources.selectors"> <and xmlns="antlib:org.apache.tools.ant.types.resources.selectors">
<contains text="${x} out" /> <contains text="${x} out" />
<contains text="${y} out" /> <contains text="${y} out" />
@@ -144,8 +149,8 @@
</target> </target>


<target name="testRedirect2" depends="xyz" if="test.can.run"> <target name="testRedirect2" depends="xyz" if="test.can.run">
<apply executable="sh" output="redirect.out"
error="redirect.err" append="true">
<apply executable="sh" output="${output}/redirect.out"
error="${output}/redirect.err" append="true">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>
@@ -154,11 +159,11 @@
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirect.out" />
<file file="${output}/redirect.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} err${eol}${y} err${eol}${z} err" /> <string value="${x} err${eol}${y} err${eol}${z} err" />
<file file="redirect.err" />
<file file="${output}/redirect.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
</au:assertTrue> </au:assertTrue>
@@ -166,7 +171,7 @@


<target name="testRedirect3" depends="xyz" if="test.can.run"> <target name="testRedirect3" depends="xyz" if="test.can.run">
<apply executable="sh" logerror="true" append="true" <apply executable="sh" logerror="true" append="true"
output="redirect.out" outputproperty="redirect3.out">
output="${output}/redirect.out" outputproperty="redirect3.out">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>
@@ -174,7 +179,7 @@
<au:assertTrue> <au:assertTrue>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirect.out" />
<file file="${output}/redirect.out" />
<propertyresource name="redirect3.out" /> <propertyresource name="redirect3.out" />
</resourcesmatch> </resourcesmatch>
</au:assertTrue> </au:assertTrue>
@@ -186,8 +191,8 @@


<target name="testRedirect4" depends="xyz" if="test.can.run"> <target name="testRedirect4" depends="xyz" if="test.can.run">
<apply executable="sh" append="true" <apply executable="sh" append="true"
error="redirect.err" errorproperty="redirect4.err"
output="redirect.out" outputproperty="redirect4.out">
error="${output}/redirect.err" errorproperty="redirect4.err"
output="${output}/redirect.out" outputproperty="redirect4.out">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>
@@ -196,12 +201,12 @@
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirect.out" />
<file file="${output}/redirect.out" />
<propertyresource name="redirect4.out" /> <propertyresource name="redirect4.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} err${eol}${y} err${eol}${z} err" /> <string value="${x} err${eol}${y} err${eol}${z} err" />
<file file="redirect.err" />
<file file="${output}/redirect.err" />
<propertyresource name="redirect4.err" /> <propertyresource name="redirect4.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
@@ -210,8 +215,8 @@


<target name="testRedirect5" depends="xyz" if="sed.can.run"> <target name="testRedirect5" depends="xyz" if="sed.can.run">
<apply executable="sed" inputstring="x y z${eol}" append="true" <apply executable="sed" inputstring="x y z${eol}" append="true"
error="redirect.err" errorproperty="redirect5.err"
output="redirect.out" outputproperty="redirect5.out">
error="${output}/redirect.err" errorproperty="redirect5.err"
output="${output}/redirect.out" outputproperty="redirect5.out">
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>
@@ -221,19 +226,19 @@
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<propertyresource name="redirect5.out" /> <propertyresource name="redirect5.out" />
<string value="blah y z${eol}x blah z${eol}x y blah" /> <string value="blah y z${eol}x blah z${eol}x y blah" />
<file file="redirect.out" />
<file file="${output}/redirect.out" />
</resourcesmatch> </resourcesmatch>
<equals arg1="${redirect5.err}" arg2="" /> <equals arg1="${redirect5.err}" arg2="" />
</and> </and>
</au:assertTrue> </au:assertTrue>
<assertEmptyFile file="redirect.err" />
<assertEmptyFile file="${output}/redirect.err" />
</target> </target>


<target name="testRedirect6" depends="xyz" if="sed.can.run"> <target name="testRedirect6" depends="xyz" if="sed.can.run">
<echo file="redirect.in">x y z${eol}</echo>
<apply executable="sed" input="redirect.in" append="true"
error="redirect.err" errorproperty="redirect6.err"
output="redirect.out" outputproperty="redirect6.out">
<echo file="${input}/redirect.in">x y z${eol}</echo>
<apply executable="sed" input="${input}/redirect.in" append="true"
error="${output}/redirect.err" errorproperty="redirect6.err"
output="${output}/redirect.out" outputproperty="redirect6.out">
<arg value="-f" /> <arg value="-f" />
<filelist refid="xyzlist" /> <filelist refid="xyzlist" />
</apply> </apply>
@@ -243,17 +248,17 @@
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<propertyresource name="redirect6.out" /> <propertyresource name="redirect6.out" />
<string value="blah y z${eol}x blah z${eol}x y blah" /> <string value="blah y z${eol}x blah z${eol}x y blah" />
<file file="redirect.out" />
<file file="${output}/redirect.out" />
</resourcesmatch> </resourcesmatch>
<equals arg1="${redirect6.err}" arg2="" /> <equals arg1="${redirect6.err}" arg2="" />
<length length="0"><file file="redirect.err" /></length>
<length length="0"><file file="${output}/redirect.err" /></length>
</and> </and>
</au:assertTrue> </au:assertTrue>
</target> </target>


<target name="testRedirect7" depends="xyz" if="sed.can.run"> <target name="testRedirect7" depends="xyz" if="sed.can.run">
<apply executable="sed" inputstring="x y z${eol}" <apply executable="sed" inputstring="x y z${eol}"
error="redirect.err" output="redirect.out"
error="${output}/redirect.err" output="${output}/redirect.out"
outputproperty="redirect7.out"> outputproperty="redirect7.out">
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -263,12 +268,12 @@
<and> <and>
<equals arg1="${redirect7.out}" arg2="blah y z" /> <equals arg1="${redirect7.out}" arg2="blah y z" />
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<file file="redirect.out" />
<file file="${output}/redirect.out" />
<string value="x y blah" /> <string value="x y blah" />
</resourcesmatch> </resourcesmatch>
</and> </and>
</au:assertTrue> </au:assertTrue>
<assertEmptyFile file="redirect.err" />
<assertEmptyFile file="${output}/redirect.err" />
</target> </target>


<target name="testRedirector1" description="fail" <target name="testRedirector1" description="fail"
@@ -278,8 +283,8 @@
<apply executable="sh"> <apply executable="sh">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
<redirector output="redirector.out" />
<redirector output="whocares" />
<redirector output="${output}/redirector.out" />
<redirector output="${output}/whocares" />
</apply> </apply>
</au:expectfailure> </au:expectfailure>
</target> </target>
@@ -288,12 +293,12 @@
<apply executable="sh"> <apply executable="sh">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
<redirector output="redirector.out" append="true" />
<redirector output="${output}/redirector.out" append="true" />
</apply> </apply>
<au:assertTrue> <au:assertTrue>
<resourcecount count="1"> <resourcecount count="1">
<restrict id="results"> <restrict id="results">
<file file="redirector.out" />
<file file="${output}/redirector.out" />
<and xmlns="antlib:org.apache.tools.ant.types.resources.selectors"> <and xmlns="antlib:org.apache.tools.ant.types.resources.selectors">
<contains text="${x} out" /> <contains text="${x} out" />
<contains text="${y} out" /> <contains text="${y} out" />
@@ -312,17 +317,18 @@
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
<redirector append="true" <redirector append="true"
output="redirector.out" error="redirector.err" />
output="${output}/redirector.out"
error="${output}/redirector.err" />
</apply> </apply>
<au:assertTrue> <au:assertTrue>
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} err${eol}${y} err${eol}${z} err" /> <string value="${x} err${eol}${y} err${eol}${z} err" />
<file file="redirector.err" />
<file file="${output}/redirector.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
</au:assertTrue> </au:assertTrue>
@@ -332,14 +338,14 @@
<apply executable="sh"> <apply executable="sh">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
<redirector output="redirector.out" logerror="true"
<redirector output="${output}/redirector.out" logerror="true"
append="true" outputproperty="redirector4.out" /> append="true" outputproperty="redirector4.out" />
</apply> </apply>


<au:assertTrue> <au:assertTrue>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
<propertyresource name="redirector4.out" /> <propertyresource name="redirector4.out" />
</resourcesmatch> </resourcesmatch>
</au:assertTrue> </au:assertTrue>
@@ -351,8 +357,10 @@


<target name="testRedirector5" depends="xyz" if="test.can.run"> <target name="testRedirector5" depends="xyz" if="test.can.run">
<apply executable="sh"> <apply executable="sh">
<redirector error="redirector.err" errorproperty="redirector5.err"
output="redirector.out" outputproperty="redirector5.out"
<redirector error="${output}/redirector.err"
errorproperty="redirector5.err"
output="${output}/redirector.out"
outputproperty="redirector5.out"
append="true" /> append="true" />
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -361,12 +369,12 @@
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
<propertyresource name="redirector5.out" /> <propertyresource name="redirector5.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} err${eol}${y} err${eol}${z} err" /> <string value="${x} err${eol}${y} err${eol}${z} err" />
<file file="redirector.err" />
<file file="${output}/redirector.err" />
<propertyresource name="redirector5.err" /> <propertyresource name="redirector5.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
@@ -377,8 +385,8 @@
<apply executable="sh"> <apply executable="sh">
<redirector append="true" outputproperty="redirector6.out" <redirector append="true" outputproperty="redirector6.out"
errorproperty="redirector6.err"> errorproperty="redirector6.err">
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<filelist refid="xyzlist" /> <filelist refid="xyzlist" />
@@ -388,12 +396,12 @@
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
<propertyresource name="redirector6.out" /> <propertyresource name="redirector6.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} err${eol}${y} err${eol}${z} err" /> <string value="${x} err${eol}${y} err${eol}${z} err" />
<file file="redirector.err" />
<file file="${output}/redirector.err" />
<propertyresource name="redirector6.err" /> <propertyresource name="redirector6.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
@@ -404,8 +412,8 @@
<apply executable="sh"> <apply executable="sh">
<redirector append="true" outputproperty="redirector7.out" <redirector append="true" outputproperty="redirector7.out"
errorproperty="redirector7.err"> errorproperty="redirector7.err">
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
<errorfilterchain> <errorfilterchain>
<replacestring from="err" to="ERROR!!!" /> <replacestring from="err" to="ERROR!!!" />
</errorfilterchain> </errorfilterchain>
@@ -418,12 +426,12 @@
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} out${eol}${y} out${eol}${z} out" /> <string value="${x} out${eol}${y} out${eol}${z} out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
<propertyresource name="redirector7.out" /> <propertyresource name="redirector7.out" />
</resourcesmatch> </resourcesmatch>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="${x} ERROR!!!${eol}${y} ERROR!!!${eol}${z} ERROR!!!" /> <string value="${x} ERROR!!!${eol}${y} ERROR!!!${eol}${z} ERROR!!!" />
<file file="redirector.err" />
<file file="${output}/redirector.err" />
<propertyresource name="redirector7.err" /> <propertyresource name="redirector7.err" />
</resourcesmatch> </resourcesmatch>
</and> </and>
@@ -431,13 +439,13 @@
</target> </target>


<target name="testRedirector8" depends="xyz" if="sed.can.run"> <target name="testRedirector8" depends="xyz" if="sed.can.run">
<echo file="redirector.in">x y z${eol}</echo>
<echo file="${input}/redirector.in">x y z${eol}</echo>
<apply executable="sed"> <apply executable="sed">
<redirector append="true" outputproperty="redirector8.out" <redirector append="true" outputproperty="redirector8.out"
errorproperty="redirector8.err"> errorproperty="redirector8.err">
<inputmapper type="merge" to="redirector.in" />
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<inputmapper type="merge" to="${input}/redirector.in" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -448,12 +456,12 @@
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<propertyresource name="redirector8.out" /> <propertyresource name="redirector8.out" />
<string value="blah y z${eol}x blah z${eol}x y blah" /> <string value="blah y z${eol}x blah z${eol}x y blah" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
</resourcesmatch> </resourcesmatch>
<equals arg1="${redirector8.err}" arg2="" /> <equals arg1="${redirector8.err}" arg2="" />
</and> </and>
</au:assertTrue> </au:assertTrue>
<assertEmptyFile file="redirector.err" />
<assertEmptyFile file="${output}/redirector.err" />
</target> </target>


<macrodef name="valRor9-12"> <macrodef name="valRor9-12">
@@ -465,25 +473,25 @@
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="blah after y after z${eol}x after blah after z${eol}x after y after blah" /> <string value="blah after y after z${eol}x after blah after z${eol}x after y after blah" />
<propertyresource name="redirector@{n}.out" /> <propertyresource name="redirector@{n}.out" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
</resourcesmatch> </resourcesmatch>
</and> </and>
</au:assertTrue> </au:assertTrue>
<assertEmptyFile file="redirector.err" />
<assertEmptyFile file="${output}/redirector.err" />
</sequential> </sequential>
</macrodef> </macrodef>


<target name="testRedirector9" depends="xyz" if="sed.can.run"> <target name="testRedirector9" depends="xyz" if="sed.can.run">
<echo file="redirector.in">x before y before z${eol}</echo>
<echo file="${input}/redirector.in">x before y before z${eol}</echo>
<apply executable="sed"> <apply executable="sed">
<redirector outputproperty="redirector9.out" <redirector outputproperty="redirector9.out"
errorproperty="redirector9.err" append="true"> errorproperty="redirector9.err" append="true">
<inputfilterchain> <inputfilterchain>
<replacestring from="before" to="after" /> <replacestring from="before" to="after" />
</inputfilterchain> </inputfilterchain>
<inputmapper type="merge" to="redirector.in" />
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<inputmapper type="merge" to="${input}/redirector.in" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -493,19 +501,19 @@
</target> </target>


<target name="testRedirector10" depends="xyz" if="sed.can.run"> <target name="testRedirector10" depends="xyz" if="sed.can.run">
<echo file="redirector.in">x before y before z${eol}</echo>
<echo file="${input}/redirector.in">x before y before z${eol}</echo>
<apply executable="sed"> <apply executable="sed">
<redirector outputproperty="redirector10.out" <redirector outputproperty="redirector10.out"
errorproperty="redirector10.err" append="true"> errorproperty="redirector10.err" append="true">
<outputfilterchain> <outputfilterchain>
<replacestring from="before" to="after" /> <replacestring from="before" to="after" />
</outputfilterchain> </outputfilterchain>
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<srcfile /> <srcfile />
<arg value="redirector.in" />
<arg value="${input}/redirector.in" />
<filelist refid="xyzlist" /> <filelist refid="xyzlist" />
</apply> </apply>


@@ -521,8 +529,8 @@
<inputfilterchain> <inputfilterchain>
<replacestring from="before" to="after" /> <replacestring from="before" to="after" />
</inputfilterchain> </inputfilterchain>
<outputmapper type="merge" to="redirector.out" />
<errormapper type="merge" to="redirector.err" />
<outputmapper type="merge" to="${output}/redirector.out" />
<errormapper type="merge" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -532,8 +540,9 @@
</target> </target>


<target name="testRedirector12" depends="xyz" if="sed.can.run"> <target name="testRedirector12" depends="xyz" if="sed.can.run">
<echo file="redirector.in">x before y before z${eol}</echo>
<apply executable="sed" output="redirector.out" error="redirector.err">
<echo file="${input}/redirector.in">x before y before z${eol}</echo>
<apply executable="sed" output="${output}/redirector.out"
error="${output}/redirector.err">
<redirector outputproperty="redirector12.out" <redirector outputproperty="redirector12.out"
errorproperty="redirector12.err" append="true"> errorproperty="redirector12.err" append="true">
<outputfilterchain> <outputfilterchain>
@@ -544,7 +553,7 @@
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<srcfile /> <srcfile />
<arg value="redirector.in" />
<arg value="${input}/redirector.in" />
<filelist refid="xyzlist" /> <filelist refid="xyzlist" />
</apply> </apply>


@@ -574,39 +583,32 @@
</target> </target>


<target name="testRedirector14" depends="xyz" if="sed.can.run"> <target name="testRedirector14" depends="xyz" if="sed.can.run">
<echo file="redirector.in">z before y before x${eol}</echo>
<echo file="${input}/redirector.in">z before y before x${eol}</echo>
<apply executable="sed"> <apply executable="sed">
<redirector append="true" <redirector append="true"
inputstring="x before y before z${eol}"> inputstring="x before y before z${eol}">
<outputfilterchain> <outputfilterchain>
<replacestring from="before" to="after" /> <replacestring from="before" to="after" />
</outputfilterchain> </outputfilterchain>
<inputmapper type="glob" from="x" to="redirector.in" />
<outputmapper type="glob" from="y" to="redirector.out" />
<errormapper type="glob" from="z" to="redirector.err" />
<inputmapper type="glob" from="x" to="${input}/redirector.in" />
<outputmapper type="glob" from="y" to="${output}/redirector.out" />
<errormapper type="glob" from="z" to="${output}/redirector.err" />
</redirector> </redirector>
<arg value="-f" /> <arg value="-f" />
<fileset refid="xyz" /> <fileset refid="xyz" />
</apply> </apply>


<assertEmptyFile file="redirector.err" />
<assertEmptyFile file="${output}/redirector.err" />


<au:assertTrue> <au:assertTrue>
<and>
<resourcesmatch astext="true">
<string value="z after y after blahx after y after blah" />
<au:logcontent />
</resourcesmatch>
</and>
</au:assertTrue>
<au:assertTrue message="${logcontent}">
<and> <and>
<resourcesmatch astext="true"> <resourcesmatch astext="true">
<string value="x after blah after z" /> <string value="x after blah after z" />
<file file="redirector.out" />
<file file="${output}/redirector.out" />
</resourcesmatch> </resourcesmatch>
</and> </and>
</au:assertTrue> </au:assertTrue>
<au:assertLogContains text="z after y after blahx after y after blah"/>
</target> </target>


<target name="pad"> <target name="pad">
@@ -636,8 +638,8 @@
</target> </target>


<target name="testIgnoreMissing" depends="xyz,pad" if="echo.can.run"> <target name="testIgnoreMissing" depends="xyz,pad" if="echo.can.run">
<filelist id="xylist" dir="${basedir}" files="x,y" />
<delete file="z" />
<filelist id="xylist" dir="${input}" files="x,y" />
<delete file="${input}/z" />


<pathconvert property="xy" pathsep="${pad}${eol}" refid="xylist" /> <pathconvert property="xy" pathsep="${pad}${eol}" refid="xylist" />


@@ -663,7 +665,7 @@


<target name="testForce" depends="xyz,pad" if="echo.can.run"> <target name="testForce" depends="xyz,pad" if="echo.can.run">
<presetdef name="ekko"> <presetdef name="ekko">
<apply executable="echo" append="true" dest="${basedir}">
<apply executable="echo" append="true" dest="${input}">
<filelist refid="xyzlist" /> <filelist refid="xyzlist" />
<mapper type="identity" /> <mapper type="identity" />
</apply> </apply>
@@ -685,12 +687,12 @@
<target name="testNoDest" depends="xyz" if="echo.can.run"> <target name="testNoDest" depends="xyz" if="echo.can.run">
<presetdef name="ekko"> <presetdef name="ekko">
<apply executable="echo" addsourcefile="false" force="true"> <apply executable="echo" addsourcefile="false" force="true">
<filelist dir="${basedir}" files="x" />
<globmapper from="*" to="${basedir}/*" />
<filelist dir="${input}" files="x" />
<globmapper from="*" to="${input}/*" />
<targetfile /> <targetfile />
</apply> </apply>
</presetdef> </presetdef>
<ekko outputproperty="dest" dest="${basedir}" />
<ekko outputproperty="dest" dest="${input}" />
<ekko outputproperty="nodest" /> <ekko outputproperty="nodest" />


<au:assertFileDoesntExist file="${dest}" /> <au:assertFileDoesntExist file="${dest}" />
@@ -699,7 +701,7 @@


<target name="testLsPath" if="ls.can.run" depends="xyz"> <target name="testLsPath" if="ls.can.run" depends="xyz">
<apply executable="ls" parallel="false" outputproperty="lsPathOut" <apply executable="ls" parallel="false" outputproperty="lsPathOut"
force="true" dest="${basedir}" append="true" type="both">
force="true" dest="${input}" append="true" type="both">
<path path="${env.PATH}" /> <path path="${env.PATH}" />
<identitymapper/> <identitymapper/>
</apply> </apply>
@@ -716,7 +718,7 @@


<target name="testLsPathParallel" if="ls.can.run" depends="xyz"> <target name="testLsPathParallel" if="ls.can.run" depends="xyz">
<apply executable="ls" parallel="true" outputproperty="lsPathParallelOut" <apply executable="ls" parallel="true" outputproperty="lsPathParallelOut"
force="true" dest="${basedir}" append="true" type="both">
force="true" dest="${input}" append="true" type="both">
<path path="${env.PATH}" /> <path path="${env.PATH}" />
<identitymapper/> <identitymapper/>
</apply> </apply>
@@ -743,7 +745,7 @@
</target> </target>


<target name="testTargetfileSuffix" if="test.can.run" depends="xyz"> <target name="testTargetfileSuffix" if="test.can.run" depends="xyz">
<apply executable="sh" addsourcefile="false" dest="${basedir}">
<apply executable="sh" addsourcefile="false" dest="${input}">
<arg value="parrot.sh" /> <arg value="parrot.sh" />
<targetfile suffix=",x"/> <targetfile suffix=",x"/>
<fileset refid="xyz" /> <fileset refid="xyz" />
@@ -754,11 +756,4 @@
<au:assertLogContains text="${z}.bar,x out" /> <au:assertLogContains text="${z}.bar,x out" />
</target> </target>


<target name="tearDown">
<delete>
<fileset refid="xyz" />
<fileset dir="${basedir}" includes="redirect.*" />
<fileset dir="${basedir}" includes="redirector.*" />
</delete>
</target>
</project> </project>

Loading…
Cancel
Save