Browse Source

move an antunity test

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@708936 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 16 years ago
parent
commit
b374c9f8a0
3 changed files with 34 additions and 30 deletions
  1. +0
    -26
      src/etc/testcases/taskdefs/concat.xml
  2. +34
    -0
      src/tests/antunit/taskdefs/concat-test.xml
  3. +0
    -4
      src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java

+ 0
- 26
src/etc/testcases/taskdefs/concat.xml View File

@@ -202,30 +202,4 @@
</concat>
</target>

<target name="testResources" unless="offline">
<concat destfile="concat.urls" binary="true">
<url url="http://ant.apache.org" />
<url url="http://ant.apache.org" />
</concat>
<length property="expected">
<resources>
<url url="http://ant.apache.org" />
<url url="http://ant.apache.org" />
</resources>
</length>
<length property="actual">
<fileset file="concat.urls" />
</length>
<fail>
<condition>
<or>
<equals arg1="${actual}" arg2="0" />
<not>
<equals arg1="${actual}" arg2="${expected}" />
</not>
</or>
</condition>
</fail>
</target>

</project>

+ 34
- 0
src/tests/antunit/taskdefs/concat-test.xml View File

@@ -18,6 +18,10 @@
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml" />

<target name="tearDown">
<delete file="concat.resources" />
</target>

<property name="encodeStringDest" location="${output}/encodeStringDest"/>

<target name="testBinaryAppend">
@@ -115,4 +119,34 @@
<au:assertFileExists file="${output}/TESTDEST"/>
<au:assertResourceContains resource="${output}/TESTDEST" value="footer"/>
</target>

<target name="testResources">
<string id="s1">The Quick Brown Fox</string>
<string id="s2">Jumped Over The Lazy Dog.</string>

<concat destfile="concat.resources" binary="true">
<resource refid="s1" />
<resource refid="s2" />
</concat>
<length property="expected">
<resources>
<resource refid="s1" />
<resource refid="s2" />
</resources>
</length>
<length property="actual">
<file file="concat.resources" />
</length>
<fail>
<condition>
<or>
<equals arg1="${actual}" arg2="0" />
<not>
<equals arg1="${actual}" arg2="${expected}" />
</not>
</or>
</condition>
</fail>
</target>

</project>

+ 0
- 4
src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java View File

@@ -278,8 +278,4 @@ public class ConcatTest
FILE_UTILS.contentEquals(f1, f2));
}

public void testResources() {
executeTarget("testResources");
}

}

Loading…
Cancel
Save