Browse Source

Demonstrate bug 18403

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274319 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
130eef527e
2 changed files with 17 additions and 0 deletions
  1. +7
    -0
      src/etc/testcases/taskdefs/zip.xml
  2. +10
    -0
      src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java

+ 7
- 0
src/etc/testcases/taskdefs/zip.xml View File

@@ -95,6 +95,13 @@
update="true" /> update="true" />
</target> </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"> <target name="cleanup">
<delete file="test3.zip"/> <delete file="test3.zip"/>
<delete file="test4.zip"/> <delete file="test4.zip"/>


+ 10
- 0
src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java View File

@@ -57,6 +57,7 @@ import org.apache.tools.ant.BuildFileTest;


import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import java.util.Enumeration; import java.util.Enumeration;


@@ -134,4 +135,13 @@ public class ZipTest extends BuildFileTest {
public void testUpdateIsNecessary() { public void testUpdateIsNecessary() {
expectLogContaining("testUpdateIsNecessary", "Updating"); 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);
}
} }

Loading…
Cancel
Save