commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1570567 - in /commons/proper/compress/trunk/src/test: java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java java/org/apache/commons/compress/archivers/zip/ZipFileTest.java resources/COMPRESS-264.zip
Date Fri, 21 Feb 2014 13:30:53 GMT
Author: bodewig
Date: Fri Feb 21 13:30:53 2014
New Revision: 1570567

URL: http://svn.apache.org/r1570567
Log:
COMPRESS-264 add a (failing) Unit Test

Added:
    commons/proper/compress/trunk/src/test/resources/COMPRESS-264.zip   (with props)
Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java?rev=1570567&r1=1570566&r2=1570567&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
Fri Feb 21 13:30:53 2014
@@ -149,4 +149,24 @@ public class ZipArchiveInputStreamTest {
             original.close();
         }
     }
+
+
+    /**
+     * Test case for 
+     * <a href="https://issues.apache.org/jira/browse/COMPRESS-264"
+     * >COMPRESS-264</a>.
+     */
+    //@Test
+    public void testCompress264() throws Exception {
+        ZipArchiveInputStream in = new ZipArchiveInputStream(new FileInputStream(getFile("COMPRESS-264.zip")));
+        
+        try {
+            ZipArchiveEntry ze = in.getNextZipEntry();
+            assertEquals(5, ze.getSize());
+            assertArrayEquals(new byte[] {'d', 'a', 't', 'a', '\n'},
+                              IOUtils.toByteArray(in));
+        } finally {
+            in.close();
+        }
+    }
 }

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java?rev=1570567&r1=1570566&r2=1570567&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
Fri Feb 21 13:30:53 2014
@@ -258,6 +258,20 @@ public class ZipFileTest extends TestCas
         }
     }
 
+    /**
+     * Test case for 
+     * <a href="https://issues.apache.org/jira/browse/COMPRESS-264"
+     * >COMPRESS-264</a>.
+     */
+    public void testCompress264() throws Exception {
+        File archive = getFile("COMPRESS-264.zip");
+        zf = new ZipFile(archive);
+        ZipArchiveEntry ze = zf.getEntry("test.txt");
+        assertEquals(5, ze.getSize());
+        assertArrayEquals(new byte[] {'d', 'a', 't', 'a', '\n'},
+                          IOUtils.toByteArray(zf.getInputStream(ze)));
+    }
+
     /*
      * ordertest.zip has been handcrafted.
      *

Added: commons/proper/compress/trunk/src/test/resources/COMPRESS-264.zip
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/resources/COMPRESS-264.zip?rev=1570567&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/compress/trunk/src/test/resources/COMPRESS-264.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message