commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r943649 - in /commons/proper/compress/trunk/src/test: java/org/apache/commons/compress/archivers/LongPathTest.java resources/longpath/minotaur.cpio
Date Wed, 12 May 2010 19:37:26 GMT
Author: sebb
Date: Wed May 12 19:37:25 2010
New Revision: 943649

URL: http://svn.apache.org/viewvc?rev=943649&view=rev
Log:
Add cpio version of test
Note: had to hack file list because cpio does not add trailing "/" to directory names

Added:
    commons/proper/compress/trunk/src/test/resources/longpath/minotaur.cpio   (with props)
Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java?rev=943649&r1=943648&r2=943649&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/LongPathTest.java
Wed May 12 19:37:25 2010
@@ -31,6 +31,7 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.commons.compress.AbstractTestCase;
+import org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream;
 import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
 import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
 
@@ -60,7 +61,7 @@ public class LongPathTest extends Abstra
     }
     
     public static TestSuite suite() throws IOException{
-        TestSuite suite = new TestSuite("TarReadTests");
+        TestSuite suite = new TestSuite("LongPathTests");
         File arcdir =new File(classLoader.getResource("longpath").getFile());
         assertTrue(arcdir.exists());
         File listing= new File(arcdir,"files.txt");
@@ -102,6 +103,15 @@ public class LongPathTest extends Abstra
             assertTrue(ais instanceof TarArchiveInputStream);
         } else if (name.endsWith(".jar") || name.endsWith(".zip")){
             assertTrue(ais instanceof ZipArchiveInputStream);
+        } else if (name.endsWith(".cpio")){
+            assertTrue(ais instanceof CpioArchiveInputStream);
+            // Hack: cpio does not add trailing "/" to directory names
+            for(int i=0; i < expected.size(); i++){
+                String ent = (String) expected.get(i);
+                if (ent.endsWith("/")){
+                    expected.set(i, ent.substring(0, ent.length()-1));
+                }
+            }
         } else {
             fail("Unexpected file type: "+name);
         }

Added: commons/proper/compress/trunk/src/test/resources/longpath/minotaur.cpio
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/resources/longpath/minotaur.cpio?rev=943649&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/compress/trunk/src/test/resources/longpath/minotaur.cpio
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message