Browse Source

refactor sync tests in preparation for more changes WRT PR 43159

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@727727 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
4f0c76df89
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      src/tests/antunit/taskdefs/sync-test.xml

+ 19
- 1
src/tests/antunit/taskdefs/sync-test.xml View File

@@ -18,13 +18,16 @@
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml" />

<target name="testPreserveEmptyDirs">
<target name="setUp">
<mkdir dir="${input}/a"/>
<mkdir dir="${output}/a"/>
<mkdir dir="${output}/b/c"/>
<touch file="${input}/a/foo.txt"/>
<touch file="${output}/a/bar.txt"/>
<touch file="${output}/b/baz.txt"/>
</target>

<target name="testIncludeEmptyPreservesEmptyDirs" depends="setUp">

<sync todir="${output}" includeemptydirs="true">
<fileset dir="${input}"/>
@@ -38,4 +41,19 @@
<au:assertFileExists file="${output}/b/baz.txt"/>
<au:assertFileExists file="${output}/b/c"/>
</target>

<target name="testDefaultDoesntPreserveEmptyDirs" depends="setUp">

<sync todir="${output}">
<fileset dir="${input}"/>
<preserveintarget>
<include name="**/b/**"/>
</preserveintarget>
</sync>

<au:assertFileDoesntExist file="${output}/a/bar.txt"/>
<au:assertFileExists file="${output}/a/foo.txt"/>
<au:assertFileExists file="${output}/b/baz.txt"/>
<au:assertFileDoesntExist file="${output}/b/c"/>
</target>
</project>

Loading…
Cancel
Save