ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs ZipTest.java
Date Fri, 18 Feb 2005 12:19:37 GMT
bodewig     2005/02/18 04:19:37

  Modified:    src/etc/testcases/taskdefs zip.xml
               src/testcases/org/apache/tools/ant/taskdefs ZipTest.java
  Log:
  Test for PR 33412
  
  Revision  Changes    Path
  1.18      +11 -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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- zip.xml	2 Feb 2005 23:55:51 -0000	1.17
  +++ zip.xml	18 Feb 2005 12:19:37 -0000	1.18
  @@ -156,6 +156,17 @@
       </fail>
     </target>
   
  +  <!-- Bugzilla Report 33412 -->
  +  <target name="testDefaultExcludesAndUpdate">
  +    <mkdir dir="ziptest"/>
  +    <touch file="ziptest/ziptest~"/>
  +    <zip destfile="test3.zip" basedir="ziptest" defaultexcludes="false"/>
  +    <touch file="ziptest/ziptest2"/>
  +    <zip destfile="test3.zip" basedir="ziptest"
  +      defaultexcludes="false"
  +      update="true"/>
  +  </target>
  +
     <target name="cleanup">
       <delete file="test3.zip"/>
       <delete file="test4.zip"/>
  
  
  
  1.26      +20 -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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ZipTest.java	4 Feb 2005 08:02:59 -0000	1.25
  +++ ZipTest.java	18 Feb 2005 12:19:37 -0000	1.26
  @@ -21,6 +21,7 @@
   import java.io.File;
   import java.io.IOException;
   import java.util.zip.ZipEntry;
  +import java.util.zip.ZipException;
   import java.util.zip.ZipFile;
   import java.util.Enumeration;
   
  @@ -49,9 +50,9 @@
           expectBuildException("test3", "zip cannot include itself");
       }
   
  -//    public void test4() {
  -//        expectBuildException("test4", "zip cannot include itself");
  -//    }
  +    //    public void test4() {
  +    //        expectBuildException("test4", "zip cannot include itself");
  +    //    }
   
       public void tearDown() {
           try {
  @@ -148,4 +149,20 @@
       public void testCompressionLevel() {
           executeTarget("testCompressionLevel");
       }
  +
  +    // Bugzilla Report 33412
  +    public void testDefaultExcludesAndUpdate() 
  +        throws ZipException, IOException {
  +        executeTarget("testDefaultExcludesAndUpdate");
  +        ZipFile f = null;
  +        try {
  +            f = new ZipFile(getProject().resolveFile("test3.zip"));
  +            assertNotNull("ziptest~ should be included",
  +                          f.getEntry("ziptest~"));
  +        } finally {
  +            if (f != null) {
  +                f.close();
  +            }
  +        }
  +    }
   }
  
  
  

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


Mime
View raw message