Browse Source

finish antunitizing length test

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@536570 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
6c7290dcbe
1 changed files with 28 additions and 20 deletions
  1. +28
    -20
      src/tests/antunit/taskdefs/length-test.xml

+ 28
- 20
src/tests/antunit/taskdefs/length-test.xml View File

@@ -1,10 +1,14 @@
<project name="length">
<project name="length-test" default="antunit"
xmlns:au="antlib:org.apache.ant.antunit">

<import file="../antunit-base.xml" />

<property name="dir" location="lengthtestdir" /> <property name="dir" location="lengthtestdir" />
<property name="dir.a" location="${dir}/a" /> <property name="dir.a" location="${dir}/a" />
<property name="dir.b" location="${dir}/b" /> <property name="dir.b" location="${dir}/b" />
<property name="zipfile" location="lengthtest.zip" /> <property name="zipfile" location="lengthtest.zip" />


<target name="init">
<target name="setUp">
<mkdir dir="${dir.a}" /> <mkdir dir="${dir.a}" />
<mkdir dir="${dir.b}" /> <mkdir dir="${dir.b}" />
<property name="foo" location="${dir.a}/foo" /> <property name="foo" location="${dir.a}/foo" />
@@ -13,7 +17,12 @@
<echo file="${bar}" message="bar" /> <echo file="${bar}" message="bar" />
</target> </target>


<target name="testEach" depends="init">
<target name="tearDown">
<delete dir="${dir}" />
<delete file="${zipfile}" />
</target>

<target name="testEach" depends="setUp">
<length mode="each" property="length.each"> <length mode="each" property="length.each">
<fileset id="fs" dir="${dir}" /> <fileset id="fs" dir="${dir}" />
</length> </length>
@@ -35,7 +44,7 @@
</fail> </fail>
</target> </target>


<target name="testEachCondition" depends="init">
<target name="testEachCondition" depends="setUp">
<length mode="each" property="length.each"> <length mode="each" property="length.each">
<fileset id="fs" dir="${dir}" /> <fileset id="fs" dir="${dir}" />
</length> </length>
@@ -56,7 +65,7 @@
</fail> </fail>
</target> </target>


<target name="testAll" depends="init">
<target name="testAll" depends="setUp">
<length property="length.all"> <length property="length.all">
<fileset id="foo" file="${dir.a}/foo" /> <fileset id="foo" file="${dir.a}/foo" />
<fileset id="bar" file="${dir.b}/bar" /> <fileset id="bar" file="${dir.b}/bar" />
@@ -70,7 +79,7 @@
</fail> </fail>
</target> </target>


<target name="testAllCondition" depends="init">
<target name="testAllCondition" depends="setUp">
<fail> <fail>
<condition> <condition>
<not> <not>
@@ -83,7 +92,7 @@
</fail> </fail>
</target> </target>


<target name="testFile" depends="init">
<target name="testFile" depends="setUp">
<length property="length.foo" file="${dir.a}/foo" /> <length property="length.foo" file="${dir.a}/foo" />
<fail> <fail>
<condition> <condition>
@@ -94,7 +103,7 @@
</fail> </fail>
</target> </target>


<target name="testFileCondition" depends="init">
<target name="testFileCondition" depends="setUp">
<fail> <fail>
<condition> <condition>
<not> <not>
@@ -104,7 +113,7 @@
</fail> </fail>
</target> </target>


<target name="testBoth" depends="init">
<target name="testBoth" depends="setUp">
<length property="length.foo" file="${dir.a}/foo"> <length property="length.foo" file="${dir.a}/foo">
<fileset file="${dir.b}/bar" /> <fileset file="${dir.b}/bar" />
</length> </length>
@@ -117,7 +126,7 @@
</fail> </fail>
</target> </target>


<target name="testBothCondition" depends="init">
<target name="testBothCondition" depends="setUp">
<fail> <fail>
<condition> <condition>
<not> <not>
@@ -129,7 +138,7 @@
</fail> </fail>
</target> </target>


<target name="testDupes" depends="init">
<target name="testDupes" depends="setUp">
<length property="length.foo" file="${dir.a}/foo"> <length property="length.foo" file="${dir.a}/foo">
<fileset dir="${dir}" /> <fileset dir="${dir}" />
</length> </length>
@@ -142,7 +151,7 @@
</fail> </fail>
</target> </target>


<target name="testDupesCondition" depends="init">
<target name="testDupesCondition" depends="setUp">
<fail> <fail>
<condition> <condition>
<not> <not>
@@ -218,11 +227,15 @@
</target> </target>


<target name="testTrimFile" description="should fail"> <target name="testTrimFile" description="should fail">
<length file="${ant.file}" trim="false" />
<au:expectfailure>
<length file="${ant.file}" trim="false" />
</au:expectfailure>
</target> </target>


<target name="testStringFile" description="should fail"> <target name="testStringFile" description="should fail">
<length string="foo" file="${ant.file}" />
<au:expectfailure>
<length string="foo" file="${ant.file}" />
</au:expectfailure>
</target> </target>


<target name="testImmutable"> <target name="testImmutable">
@@ -237,7 +250,7 @@
</fail> </fail>
</target> </target>


<target name="zip" depends="init">
<target name="zip" depends="setUp">
<zip destfile="${zipfile}"> <zip destfile="${zipfile}">
<fileset file="${foo}" /> <fileset file="${foo}" />
<fileset file="${bar}" /> <fileset file="${bar}" />
@@ -280,9 +293,4 @@
</fail> </fail>
</target> </target>


<target name="cleanup">
<delete dir="${dir}" />
<delete file="${zipfile}" />
</target>

</project> </project>

Loading…
Cancel
Save