[jboss-cvs] JBossAS SVN: r93840 - in projects/vfs/branches/Branch_2_1/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
Mon Sep 21 17:39:52 EDT 2009


Author: wolfc
Date: 2009-09-21 17:39:52 -0400 (Mon, 21 Sep 2009)
New Revision: 93840

Added:
   projects/vfs/branches/Branch_2_1/src/test/java/org/jboss/test/virtual/test/JBVFS122Test.java
Modified:
   projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java
Log:
JBVFS-122: unit test and fix (breaks certificate reading though)

Modified: projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java
===================================================================
--- projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java	2009-09-21 21:31:17 UTC (rev 93839)
+++ projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java	2009-09-21 21:39:52 UTC (rev 93840)
@@ -220,9 +220,9 @@
 
       InputStream is = zipFile.getInputStream(lookup);
       if (is == null)
-         throw new IOException("Entry no longer available: " + ent.getName() + " in file " + file);
+         throw new IOException("Entry no longer available: " + lookup.getName() + " in file " + file);
       
-      InputStream zis = new CertificateReaderInputStream(ent, this, is);
+      InputStream zis = new CertificateReaderInputStream(lookup, this, is);
 
       incrementRef();
       return zis;

Added: projects/vfs/branches/Branch_2_1/src/test/java/org/jboss/test/virtual/test/JBVFS122Test.java
===================================================================
--- projects/vfs/branches/Branch_2_1/src/test/java/org/jboss/test/virtual/test/JBVFS122Test.java	                        (rev 0)
+++ projects/vfs/branches/Branch_2_1/src/test/java/org/jboss/test/virtual/test/JBVFS122Test.java	2009-09-21 21:39:52 UTC (rev 93840)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.virtual.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class JBVFS122Test extends AbstractVFSTest
+{
+   public JBVFS122Test(String name)
+   {
+      super(name, true, true);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+   }
+   
+   public void test1() throws IOException
+   {
+      URL url = getResource("/vfs/test/nested/nested.jar");
+      VirtualFile root = VFS.getRoot(url);
+      assertNotNull(root);
+      
+      VirtualFile child = root.getChild("complex.jar/META-INF/MANIFEST.MF");
+      InputStream in = child.openStream();
+      in.close();
+   }
+}




More information about the jboss-cvs-commits mailing list