ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r437799 - in /ant/core/trunk/src: etc/testcases/taskdefs/zip.xml testcases/org/apache/tools/ant/taskdefs/ZipTest.java
Date Mon, 28 Aug 2006 19:39:09 GMT
Author: mbenson
Date: Mon Aug 28 12:39:08 2006
New Revision: 437799

URL: http://svn.apache.org/viewvc?rev=437799&view=rev
Log:
make whenempty-related tests antunit-esque in preparation for their new friend

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

Modified: ant/core/trunk/src/etc/testcases/taskdefs/zip.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/zip.xml?rev=437799&r1=437798&r2=437799&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/zip.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/zip.xml Mon Aug 28 12:39:08 2006
@@ -126,17 +126,52 @@
   <target name="testEmptySkip">
     <mkdir dir="ziptest"/>
     <zip destfile="test3.zip" basedir="ziptest" whenempty="skip"/>
+    <fail message="archive should get skipped">
+      <condition>
+        <available file="test3.zip" />
+      </condition>
+    </fail>
   </target>
 
   <!-- Bugzilla Report 30365 -->
   <target name="zipEmptyDir">
     <mkdir dir="empty/empty2"/>
-      <zip destfile="test3.zip" basedir="empty" update="true"/>
+    <zip destfile="test3.zip" basedir="empty" update="true"/>
+    <fail message="single-directory archive should be created">
+      <condition>
+        <or>
+          <not>
+            <available file="test3.zip" />
+          </not>
+          <resourcecount when="gt" count="0">
+            <zipfileset src="test3.zip" />
+          </resourcecount>
+          <resourcecount when="ne" count="1">
+            <restrict>
+              <exists xmlns="antlib:org.apache.tools.ant.types.resources.selectors" />
+              <zipentry zipfile="test3.zip" name="empty2/" />
+            </restrict>
+          </resourcecount>
+        </or>
+      </condition>
+    </fail>
   </target>
 
   <target name="zipEmptyCreate">
     <mkdir dir="empty"/>
     <zip destfile="test3.zip" basedir="empty" whenempty="create" includes="*.xyz"/>
+    <fail message="empty archive should be created">
+      <condition>
+        <or>
+          <not>
+           <available file="test3.zip" />
+          </not>
+          <resourcecount when="gt" count="0">
+            <zipfileset src="test3.zip" />
+          </resourcecount>
+        </or>
+      </condition>
+    </fail>
   </target>
 
   <target name="testCompressionLevel" depends="test6">

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java?rev=437799&r1=437798&r2=437799&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java Mon Aug 28 12:39:08
2006
@@ -132,19 +132,13 @@
     // Bugzilla Report 22865
     public void testEmptySkip() {
         executeTarget("testEmptySkip");
-        assertTrue("archive should get skipped",
-                   !getProject().resolveFile("test3.zip").exists());
     }
     // Bugzilla Report 30365
     public void testZipEmptyDir() {
         executeTarget("zipEmptyDir");
-        assertTrue("archive should be created",
-                   getProject().resolveFile("test3.zip").exists());
     }
     public void testZipEmptyCreate() {
         expectLogContaining("zipEmptyCreate", "Note: creating empty");
-        assertTrue("archive should be created",
-                   getProject().resolveFile("test3.zip").exists());
     }
     // Bugzilla Report 25513
     public void testCompressionLevel() {



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


Mime
View raw message