bodewig 2003/03/27 01:43:49
Modified: src/etc/testcases/taskdefs zip.xml
src/testcases/org/apache/tools/ant/taskdefs ZipTest.java
Log:
Demonstrate bug 18403
Revision Changes Path
1.11 +7 -0 ant/src/etc/testcases/taskdefs/zip.xml
Index: zip.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/zip.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- zip.xml 5 Feb 2003 10:43:07 -0000 1.10
+++ zip.xml 27 Mar 2003 09:43:48 -0000 1.11
@@ -95,6 +95,13 @@
update="true" />
</target>
+ <!-- Bugzilla Report 18403 -->
+ <target name="testPrefixAddsDir">
+ <zip destfile="test3.zip" filesonly="false">
+ <zipfileset dir="." prefix="test" includes="zip.xml"/>
+ </zip>
+ </target>
+
<target name="cleanup">
<delete file="test3.zip"/>
<delete file="test4.zip"/>
1.13 +10 -0
ant/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java
Index: ZipTest.java
===================================================================
RCS file:
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ZipTest.java 10 Feb 2003 14:14:45 -0000 1.12
+++ ZipTest.java 27 Mar 2003 09:43:49 -0000 1.13
@@ -57,6 +57,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.Enumeration;
@@ -133,5 +134,14 @@
public void testUpdateIsNecessary() {
expectLogContaining("testUpdateIsNecessary", "Updating");
+ }
+
+ // Bugzilla Report 18403
+ public void testPrefixAddsDir() throws IOException {
+ executeTarget("testPrefixAddsDir");
+ File archive = getProject().resolveFile("test3.zip");
+ ZipFile zf = new ZipFile(archive);
+ ZipEntry ze = zf.getEntry("test/");
+ assertNotNull("test/ has been added", ze);
}
}