Browse Source

An error was happening under Windows when executing the cleanup,

test3.zip could not be deleted.
This is now fixed.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274708 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
1d273bec1a
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java

+ 13
- 3
src/testcases/org/apache/tools/ant/taskdefs/ZipTest.java View File

@@ -65,7 +65,8 @@ import java.util.Enumeration;
* @author Nico Seessle <nico@seessle.de>
*/
public class ZipTest extends BuildFileTest {

//instance variable to allow cleanup
ZipFile zfPrefixAddsDir = null;
public ZipTest(String name) {
super(name);
}
@@ -91,6 +92,14 @@ public class ZipTest extends BuildFileTest {
// }

public void tearDown() {
try {
if ( zfPrefixAddsDir != null) {
zfPrefixAddsDir.close();
}

} catch (IOException e) {
//ignored
}
executeTarget("cleanup");
}

@@ -140,9 +149,10 @@ public class ZipTest extends BuildFileTest {
public void testPrefixAddsDir() throws IOException {
executeTarget("testPrefixAddsDir");
File archive = getProject().resolveFile("test3.zip");
ZipFile zf = new ZipFile(archive);
ZipEntry ze = zf.getEntry("test/");
zfPrefixAddsDir = new ZipFile(archive);
ZipEntry ze = zfPrefixAddsDir.getEntry("test/");
assertNotNull("test/ has been added", ze);

}

// Bugzilla Report 19449


Loading…
Cancel
Save