ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r497528 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/Concat.java src/tests/antunit/taskdefs/concat-test.xml
Date Thu, 18 Jan 2007 18:40:51 GMT
Author: mbenson
Date: Thu Jan 18 10:40:51 2007
New Revision: 497528

URL: http://svn.apache.org/viewvc?view=rev&rev=497528
Log:
fix binary append; BZ 41399

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml   (with props)
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=497528&r1=497527&r2=497528
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Jan 18 10:40:51 2007
@@ -40,6 +40,8 @@
 
 * Synchonization issues in PropertyHelper.  Bugzilla 41353.
 
+* <concat binary="true" append="true"> did not append.  Bugzilla 41399.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java?view=diff&rev=497528&r1=497527&r2=497528
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java Thu Jan 18 10:40:51
2007
@@ -479,7 +479,7 @@
         InputStream in = null;
         try {
             try {
-                out = new FileOutputStream(destinationFile);
+                out = new FileOutputStream(destinationFile, append);
             } catch (Exception t) {
                 throw new BuildException("Unable to open "
                     + destinationFile + " for writing", t);

Added: ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml?view=auto&rev=497528
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml Thu Jan 18 10:40:51 2007
@@ -0,0 +1,24 @@
+<project xmlns:au="antlib:org.apache.ant.antunit">
+  <target name="tearDown">
+    <delete file="binaryAppendDest" />
+  </target>
+
+  <target name="testBinaryAppend">
+    <au:assertTrue message="prerequisite conditions unmet">
+      <length length="0">
+        <!-- allow for nonexistent OR zero-length: -->
+        <fileset file="binaryAppendDest" />
+      </length>
+    </au:assertTrue>
+    <echo file="binaryAppendDest">x</echo>
+    <au:assertTrue message="destfile setup failed">
+      <length length="1" file="binaryAppendDest" />
+    </au:assertTrue>
+    <concat append="true" destfile="binaryAppendDest" binary="true">
+      <string value="x" />
+    </concat>
+    <au:assertTrue message="expected length 2">
+      <length file="binaryAppendDest" length="2" />
+    </au:assertTrue>
+  </target>
+</project>

Propchange: ant/core/trunk/src/tests/antunit/taskdefs/concat-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message