ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r943072 - in /ant/core/trunk/src: etc/testcases/taskdefs/concat.xml tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
Date Tue, 11 May 2010 10:12:23 GMT
Author: bodewig
Date: Tue May 11 10:12:23 2010
New Revision: 943072

URL: http://svn.apache.org/viewvc?rev=943072&view=rev
Log:
testcase for concat's overwrite attribute

Modified:
    ant/core/trunk/src/etc/testcases/taskdefs/concat.xml
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java

Modified: ant/core/trunk/src/etc/testcases/taskdefs/concat.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/concat.xml?rev=943072&r1=943071&r2=943072&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/concat.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/concat.xml Tue May 11 10:12:23 2010
@@ -115,6 +115,15 @@
     </concat>
   </target>
 
+  <target name="testoverwrite">
+    <touch file="${tmp.file.2}"/>
+    <!-- concat.xml is now older than tmp.file.2
+         so the following should still overwrite it -->
+    <concat destfile="${tmp.file.2}" overwrite="true">
+      <path path="concat.xml"/>
+    </concat>
+  </target>
+
   <target name="testheaderfooter">
     <concat>
       <header filtering="false" trim="yes">

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java?rev=943072&r1=943071&r2=943072&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java Tue May 11
10:12:23 2010
@@ -178,6 +178,13 @@ public class ConcatTest
         assertEquals(size, 0);
     }
 
+    public void testOverwrite() {
+        executeTarget("testoverwrite");
+        File file2 = new File(getProjectDir(), tempFile2);
+        long size = file2.length();
+        assertTrue(size > 0);
+    }
+
     public void testheaderfooter() {
         test3();
         expectLog("testheaderfooter", "headerHello, World!footer");



Mime
View raw message