[jboss-cvs] JBossAS SVN: r74283 - in projects/vfs/trunk/src: test/java/org/jboss/test/virtual/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Jun 8 07:44:01 EDT 2008


Author: mstruk
Date: 2008-06-08 07:44:00 -0400 (Sun, 08 Jun 2008)
New Revision: 74283

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipStreamWrapper.java
   projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java
Log:
Fixed a problem that showed up during tck5 testing, added a unit test for it

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipStreamWrapper.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipStreamWrapper.java	2008-06-08 10:59:58 UTC (rev 74282)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/zip/ZipStreamWrapper.java	2008-06-08 11:44:00 UTC (rev 74283)
@@ -97,7 +97,7 @@
 
 
       // then read it
-      return new SizeLimitedInputStream(zis, (int) entry.getSize());
+      return new SizeLimitedInputStream(zis, (int) ent.getSize());
    }
 
    InputStream getRootAsStream() throws FileNotFoundException

Modified: projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java
===================================================================
--- projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java	2008-06-08 10:59:58 UTC (rev 74282)
+++ projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/ZipEntryVFSContextUnitTestCase.java	2008-06-08 11:44:00 UTC (rev 74283)
@@ -160,7 +160,7 @@
    }
 
    /**
-    * Handler representing a directory must return a zero leangth stream
+    * Handler representing a directory must return a zero length stream
     *
     * @throws Exception for any error
     */
@@ -173,4 +173,21 @@
       InputStream is = sub.openStream();
       assertTrue("input stream closed", is.read() == -1);
    }
+
+   /**
+    * There was a problem with noCopy inner jars returning empty streams
+    *
+    * @throws Exception for any error
+    */
+   public void testInnerJarFileEntryOpenStream() throws Exception
+   {
+      URL url = getResource("/vfs/context/jar/nested.jar");
+      ZipEntryContext ctx = new ZipEntryContext(url);
+
+      VirtualFileHandler nested = ctx.getRoot().getChild("complex.jar");
+      VirtualFileHandler target = nested.getChild("META-INF/MANIFEST.MF");
+
+      InputStream is = target.openStream();
+      assertFalse("input stream closed", is.read() == -1);
+   }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list