git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274332 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -67,6 +67,28 @@ | |||||
| encoding="ISO8859_1" outputencoding="UTF8"/> | encoding="ISO8859_1" outputencoding="UTF8"/> | ||||
| </target> | </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"> | <target name="cleanup"> | ||||
| <delete file="copytest1.tmp"/> | <delete file="copytest1.tmp"/> | ||||
| <delete file="copytest3.tmp"/> | <delete file="copytest3.tmp"/> | ||||
| @@ -158,4 +158,24 @@ public class CopyTest extends BuildFileTest { | |||||
| File f2 = getProject().resolveFile("copytest1.tmp"); | File f2 = getProject().resolveFile("copytest1.tmp"); | ||||
| assertTrue(fileUtils.contentEquals(f1, f2)); | 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.")); | |||||
| } | |||||
| } | } | ||||