Browse Source

add testcase for PR 34764

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677871 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
0bb2e45e71
2 changed files with 23 additions and 0 deletions
  1. +8
    -0
      src/etc/testcases/taskdefs/zip.xml
  2. +15
    -0
      src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java

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

@@ -260,6 +260,14 @@
</zip>
</target>

<target name="testForBugzilla34764">
<mkdir dir="ziptest"/>
<touch file="ziptest/file1"/>
<zip destfile="test3.zip" basedir="ziptest"/>
<touch file="ziptest/file2"/>
<zip destfile="test3.zip" basedir="ziptest" update="true"/>
</target>

<target name="cleanup">
<delete file="testLevel.zip"/>
<delete file="test3.zip"/>


+ 15
- 0
src/tests/junit/org/apache/tools/ant/taskdefs/ZipTest.java View File

@@ -219,4 +219,19 @@ public class ZipTest extends BuildFileTest {
}
}

public void testForBugzilla34764() throws IOException {
executeTarget("testForBugzilla34764");
org.apache.tools.zip.ZipFile zf = null;
try {
zf = new org.apache.tools.zip.ZipFile(getProject()
.resolveFile("test3.zip"));
org.apache.tools.zip.ZipEntry ze = zf.getEntry("file1");
assertEquals(UnixStat.FILE_FLAG | 0644, ze.getUnixMode());
} finally {
if (zf != null) {
zf.close();
}
}
}

}

Loading…
Cancel
Save