Author: bodewig
Date: Thu Dec 18 06:37:46 2008
New Revision: 727727
URL: http://svn.apache.org/viewvc?rev=727727&view=rev
Log:
refactor sync tests in preparation for more changes WRT PR 43159
Modified:
ant/core/trunk/src/tests/antunit/taskdefs/sync-test.xml
Modified: ant/core/trunk/src/tests/antunit/taskdefs/sync-test.xml
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/sync-test.xml?rev=727727&r1=727726&r2=727727&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/sync-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/sync-test.xml Thu Dec 18 06:37:46
2008
@@ -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>