ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r942085 - /ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml
Date Fri, 07 May 2010 14:32:09 GMT
Author: bodewig
Date: Fri May  7 14:32:09 2010
New Revision: 942085

URL: http://svn.apache.org/viewvc?rev=942085&view=rev
Log:
testcase for PR 49261

Modified:
    ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml

Modified: ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml?rev=942085&r1=942084&r2=942085&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/copy-test.xml Fri May  7 14:32:09 2010
@@ -295,4 +295,61 @@ public class NullByteStreamResource exte
     </copy>
   </target>
 
+  <!-- stolen from ../types/readwrite-test.xml - create a read-only file -->
+  <property name="file" value="testfile"/>
+  <condition property="unix">
+    <os family="unix"/>
+  </condition>
+  <target name="createTestdir">
+    <mkdir dir="${output}"/>
+    <mkdir dir="${input}"/>
+    <touch file="${output}/${file}"/>
+  </target>
+  <target name="makeFileUnwritable"
+          depends="createTestdir,makeFileUnwritable-Unix,makeFileUnwritable-Windows"/>
+  <target name="makeFileUnwritable-Unix" id="unix">
+    <chmod file="${output}/${file}" perm="444"/>
+  </target>
+  <target name="makeFileUnwritable-Windows" unless="unix">
+    <attrib file="${output}/${file}" readonly="true"/>
+  </target>
+
+  <target name="XtestCopyOverReadOnlyFile" depends="makeFileUnwritable">
+    <sleep seconds="2"/>
+    <touch file="${input}/${file}"/>
+    <copy toDir="${output}">
+      <fileset dir="${input}"/>
+    </copy>
+  </target>
+
+  <target name="testFilteredCopyOverReadOnlyFile" depends="makeFileUnwritable">
+    <sleep seconds="2"/>
+    <touch file="${input}/${file}"/>
+    <copy toDir="${output}">
+      <fileset dir="${input}"/>
+      <filterset>
+        <filter token="foo" value="bar"/>
+      </filterset>
+    </copy>
+  </target>
+
+  <target name="XtestCopyOverReadOnlyFileWithOverwrite"
+          depends="makeFileUnwritable">
+    <touch file="${input}/${file}"/>
+    <copy toDir="${output}" overwrite="true">
+      <fileset dir="${input}"/>
+    </copy>
+  </target>
+
+  <target name="testFilteredCopyOverReadOnlyFileWithOverwrite"
+          depends="makeFileUnwritable">
+    <touch file="${input}/${file}"/>
+    <copy toDir="${output}" overwrite="true">
+      <fileset dir="${input}"/>
+      <filterset>
+        <filter token="foo" value="bar"/>
+      </filterset>
+    </copy>
+  </target>
+
 </project>



Mime
View raw message