ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs ZipTest.java
Date Tue, 24 Jun 2003 20:25:58 GMT
antoine     2003/06/24 13:25:58

  Modified:    src/testcases/org/apache/tools/ant/taskdefs ZipTest.java
  Log:
  An error was happening under Windows when executing the cleanup,
  test3.zip could not be deleted.
  This is now fixed.
  
  Revision  Changes    Path
  1.15      +13 -3     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ZipTest.java	2 May 2003 14:24:58 -0000	1.14
  +++ ZipTest.java	24 Jun 2003 20:25:58 -0000	1.15
  @@ -65,7 +65,8 @@
    * @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 void tearDown() {
  +        try {
  +            if ( zfPrefixAddsDir != null) {
  +                zfPrefixAddsDir.close();
  +            }
  +
  +        } catch (IOException e) {
  +            //ignored
  +        }
           executeTarget("cleanup");
       }
   
  @@ -140,9 +149,10 @@
       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
  
  
  

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


Mime
View raw message