[jboss-cvs] JBossAS SVN: r77861 - in projects/vfs/trunk/src/test: resources/vfs/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 3 14:23:47 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-09-03 14:23:47 -0400 (Wed, 03 Sep 2008)
New Revision: 77861
Added:
projects/vfs/trunk/src/test/resources/vfs/test/web_pkg_scope.ear
Modified:
projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java
Log:
JBVFS-57, add a test showing the problem.
Modified: projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java
===================================================================
--- projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java 2008-09-03 17:59:17 UTC (rev 77860)
+++ projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/JARVFSContextUnitTestCase.java 2008-09-03 18:23:47 UTC (rev 77861)
@@ -24,6 +24,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -230,6 +232,23 @@
assertEquals(file, same);
}
+ public void testWarClassesJarInputStream() throws Exception
+ {
+ URL rootURL = getResource("/vfs/test/web_pkg_scope.ear");
+ VFS vfs = VFS.getVFS(rootURL);
+ VirtualFile file = vfs.getChild("web_pkg_scope_web.war/WEB-INF/classes/META-INF/persistence.xml");
+ assertNotNull(file);
+ VirtualFile classes = file.getParent().getParent();
+ // Access the classes contents as a jar file
+ URL classesURL = classes.toURL();
+ JarInputStream jis = new JarInputStream( classesURL.openStream() );
+ JarEntry jarEntry = jis.getNextJarEntry();
+ assertNotNull(jarEntry);
+ String name = jarEntry.getName();
+ assertNotNull(name);
+ classes.closeStreams();
+ }
+
// we need to make sure this doesn't get touched before
protected String getNestedName()
{
Added: projects/vfs/trunk/src/test/resources/vfs/test/web_pkg_scope.ear
===================================================================
(Binary files differ)
Property changes on: projects/vfs/trunk/src/test/resources/vfs/test/web_pkg_scope.ear
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jboss-cvs-commits
mailing list