Author: mbenson Date: Wed May 9 08:39:56 2007 New Revision: 536570 URL: http://svn.apache.org/viewvc?view=rev&rev=536570 Log: finish antunitizing length test
Modified: ant/core/trunk/src/tests/antunit/taskdefs/length-test.xml Modified: ant/core/trunk/src/tests/antunit/taskdefs/length-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/length-test.xml?view=diff&rev=536570&r1=536569&r2=536570 ============================================================================== --- ant/core/trunk/src/tests/antunit/taskdefs/length-test.xml (original) +++ ant/core/trunk/src/tests/antunit/taskdefs/length-test.xml Wed May 9 08:39:56 2007 @@ -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.a" location="${dir}/a" /> <property name="dir.b" location="${dir}/b" /> <property name="zipfile" location="lengthtest.zip" /> - <target name="init"> + <target name="setUp"> <mkdir dir="${dir.a}" /> <mkdir dir="${dir.b}" /> <property name="foo" location="${dir.a}/foo" /> @@ -13,7 +17,12 @@ <echo file="${bar}" message="bar" /> </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"> <fileset id="fs" dir="${dir}" /> </length> @@ -35,7 +44,7 @@ </fail> </target> - <target name="testEachCondition" depends="init"> + <target name="testEachCondition" depends="setUp"> <length mode="each" property="length.each"> <fileset id="fs" dir="${dir}" /> </length> @@ -56,7 +65,7 @@ </fail> </target> - <target name="testAll" depends="init"> + <target name="testAll" depends="setUp"> <length property="length.all"> <fileset id="foo" file="${dir.a}/foo" /> <fileset id="bar" file="${dir.b}/bar" /> @@ -70,7 +79,7 @@ </fail> </target> - <target name="testAllCondition" depends="init"> + <target name="testAllCondition" depends="setUp"> <fail> <condition> <not> @@ -83,7 +92,7 @@ </fail> </target> - <target name="testFile" depends="init"> + <target name="testFile" depends="setUp"> <length property="length.foo" file="${dir.a}/foo" /> <fail> <condition> @@ -94,7 +103,7 @@ </fail> </target> - <target name="testFileCondition" depends="init"> + <target name="testFileCondition" depends="setUp"> <fail> <condition> <not> @@ -104,7 +113,7 @@ </fail> </target> - <target name="testBoth" depends="init"> + <target name="testBoth" depends="setUp"> <length property="length.foo" file="${dir.a}/foo"> <fileset file="${dir.b}/bar" /> </length> @@ -117,7 +126,7 @@ </fail> </target> - <target name="testBothCondition" depends="init"> + <target name="testBothCondition" depends="setUp"> <fail> <condition> <not> @@ -129,7 +138,7 @@ </fail> </target> - <target name="testDupes" depends="init"> + <target name="testDupes" depends="setUp"> <length property="length.foo" file="${dir.a}/foo"> <fileset dir="${dir}" /> </length> @@ -142,7 +151,7 @@ </fail> </target> - <target name="testDupesCondition" depends="init"> + <target name="testDupesCondition" depends="setUp"> <fail> <condition> <not> @@ -218,11 +227,15 @@ </target> <target name="testTrimFile" description="should fail"> - <length file="${ant.file}" trim="false" /> + <au:expectfailure> + <length file="${ant.file}" trim="false" /> + </au:expectfailure> </target> <target name="testStringFile" description="should fail"> - <length string="foo" file="${ant.file}" /> + <au:expectfailure> + <length string="foo" file="${ant.file}" /> + </au:expectfailure> </target> <target name="testImmutable"> @@ -237,7 +250,7 @@ </fail> </target> - <target name="zip" depends="init"> + <target name="zip" depends="setUp"> <zip destfile="${zipfile}"> <fileset file="${foo}" /> <fileset file="${bar}" /> @@ -278,11 +291,6 @@ </not> </condition> </fail> - </target> - - <target name="cleanup"> - <delete dir="${dir}" /> - <delete file="${zipfile}" /> </target> </project> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]