bodewig 2003/03/27 23:33:05
Modified: src/etc/testcases/taskdefs copy.xml
src/testcases/org/apache/tools/ant/taskdefs CopyTest.java
Log:
Demonstrate bug 18414
Revision Changes Path
1.10 +22 -0 ant/src/etc/testcases/taskdefs/copy.xml
Index: copy.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/copy.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- copy.xml 27 Mar 2003 16:32:18 -0000 1.9
+++ copy.xml 28 Mar 2003 07:33:04 -0000 1.10
@@ -67,6 +67,28 @@
encoding="ISO8859_1" outputencoding="UTF8"/>
</target>
+ <target name="testMissingFileIgnore">
+ <copy file="not-there" tofile="copytest1.tmp"
+ failonerror="false"/>
+ </target>
+
+ <target name="testMissingFileBail">
+ <copy file="not-there" tofile="copytest1.tmp"
+ failonerror="true"/>
+ </target>
+
+ <target name="testMissingDirIgnore">
+ <copy todir="copytest1dir" failonerror="false">
+ <fileset dir="not-there"/>
+ </copy>
+ </target>
+
+ <target name="testMissingDirBail">
+ <copy todir="copytest1dir" failonerror="false">
+ <fileset dir="not-there"/>
+ </copy>
+ </target>
+
<target name="cleanup">
<delete file="copytest1.tmp"/>
<delete file="copytest3.tmp"/>
1.12 +20 -0
ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java
Index: CopyTest.java
===================================================================
RCS file:
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- CopyTest.java 27 Mar 2003 16:32:19 -0000 1.11
+++ CopyTest.java 28 Mar 2003 07:33:05 -0000 1.12
@@ -158,4 +158,24 @@
File f2 = getProject().resolveFile("copytest1.tmp");
assertTrue(fileUtils.contentEquals(f1, f2));
}
+
+ public void testMissingFileIgnore() {
+ expectLogContaining("testMissingFileIgnore",
+ "Warning: Could not find file ");
+ }
+
+ public void testMissingFileBail() {
+ expectBuildException("testMissingFileBail", "not-there doesn't
exist");
+ assertTrue(getBuildException().getMessage()
+ .startsWith("Warning: Could not find file "));
+ }
+
+ public void testMissingDirIgnore() {
+ expectLogContaining("testMissingDirIgnore", "Warning: ");
+ }
+
+ public void testMissingDirBail() {
+ expectBuildException("testMissingDirBail", "not-there doesn't
exist");
+ assertTrue(getBuildException().getMessage().endsWith(" not found."));
+ }
}