ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r393299 - in /ant/core/trunk/src: etc/testcases/taskdefs/copy.xml testcases/org/apache/tools/ant/taskdefs/CopyTest.java
Date Tue, 11 Apr 2006 19:35:55 GMT
Author: mbenson
Date: Tue Apr 11 12:35:53 2006
New Revision: 393299

URL: http://svn.apache.org/viewcvs?rev=393299&view=rev
Log:
add a copy dirset test

Modified:
    ant/core/trunk/src/etc/testcases/taskdefs/copy.xml
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java

Modified: ant/core/trunk/src/etc/testcases/taskdefs/copy.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/copy.xml?rev=393299&r1=393298&r2=393299&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/copy.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/copy.xml Tue Apr 11 12:35:53 2006
@@ -201,6 +201,55 @@
     </copy>
   </target>
 
+  <target name="prepareDirset">
+    <touch mkdirs="true">
+      <filelist dir="${from.dir}/dirset">
+        <file name="a/x/foo" />
+        <file name="a/y/foo" />
+        <file name="a/z/foo" />
+        <file name="b/x/foo" />
+        <file name="b/y/foo" />
+        <file name="b/z/foo" />
+      </filelist>
+    </touch>
+    <fail>
+      <condition>
+        <or>
+          <resourcecount when="ne" count="9">
+            <dirset id="dirset" dir="${from.dir}/dirset" />
+          </resourcecount>
+          <resourcecount when="ne" count="6">
+            <fileset dir="${from.dir}/dirset" />
+          </resourcecount>
+        </or>
+      </condition>
+    </fail>
+    <delete dir="${to.dir}/dirset" />
+    <fail>
+      <condition>
+        <available file="${to.dir}/dirset" />
+      </condition>
+    </fail>
+  </target>
+
+  <target name="testDirset" depends="prepareDirset">
+    <copy todir="${to.dir}/dirset">
+      <resources refid="dirset" />
+    </copy>
+    <fail>
+      <condition>
+        <or>
+          <resourcecount when="ne" count="9">
+            <dirset dir="${to.dir}/dirset" />
+          </resourcecount>
+          <resourcecount when="ne" count="0">
+            <fileset dir="${to.dir}/dirset" />
+          </resourcecount>
+        </or>
+      </condition>
+    </fail>
+  </target>
+
   <target name="cleanup">
     <delete file="copytest1.tmp"/>
     <delete file="copytest3.tmp"/>

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java?rev=393299&r1=393298&r2=393299&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java Tue Apr 11 12:35:53
2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2005 The Apache Software Foundation
+ * Copyright 2000-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -205,6 +205,10 @@
         assertTrue(file1.exists());
         assertTrue(file2.exists());
         assertTrue(file3.exists());
+    }
+
+    public void testDirset() {
+        executeTarget("testDirset");
     }
     
     public void _testResourcePlain() {



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


Mime
View raw message