Browse Source

testcase for PR 49261

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@942085 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
63b2599798
1 changed files with 57 additions and 0 deletions
  1. +57
    -0
      src/tests/antunit/taskdefs/copy-test.xml

+ 57
- 0
src/tests/antunit/taskdefs/copy-test.xml View File

@@ -295,4 +295,61 @@ public class NullByteStreamResource extends Resource {
</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>

Loading…
Cancel
Save