[jboss-cvs] JBossAS SVN: r58958 - projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Dec 10 17:54:05 EST 2006


Author: scott.stark at jboss.org
Date: 2006-12-10 17:54:03 -0500 (Sun, 10 Dec 2006)
New Revision: 58958

Modified:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
Log:
Add a testDirURIs

Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java	2006-12-10 22:52:16 UTC (rev 58957)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java	2006-12-10 22:54:03 UTC (rev 58958)
@@ -897,6 +897,36 @@
    }
 
    /**
+    * Test that the URI of a VFS corresponding to a directory ends in '/' so that
+    * URIs created relative to it are under the directory. This requires that
+    * build-test.xml artifacts exist.
+    * 
+    * @throws Exception
+    */
+   public void testDirURIs() throws Exception
+   {
+      URL rootURL = getResource("/vfs/test");
+      VFS vfs = VFS.getVFS(rootURL);
+
+      VirtualFile outerJar = vfs.findChild("unpacked-outer.jar");
+      URI outerURI = outerJar.toURI();
+      log.debug("outerURI: "+outerURI);
+      assertTrue(outerURI+" ends in '/'", outerURI.getPath().endsWith("/"));
+      // Validate that jar1 is under unpacked-outer.jar
+      URI jar1URI = new URI(outerURI+"jar1.jar");
+      log.debug("jar1URI: "+jar1URI+", path="+jar1URI.getPath());
+      assertTrue("jar1URI path ends in unpacked-outer.jar/jar1.jar!/",
+            jar1URI.getPath().endsWith("unpacked-outer.jar/jar1.jar"));
+      VirtualFile jar1 = outerJar.findChild("jar1.jar");
+      assertEquals(jar1URI, jar1.toURI());
+
+      VirtualFile packedJar = vfs.findChild("jar1.jar");
+      jar1URI = packedJar.findChild("org/jboss/test/vfs/support").toURI();
+      assertTrue("Jar directory entry URLs must end in /: " + jar1URI.toString(),
+            jar1URI.toString().endsWith("/"));
+   }
+
+   /**
     * Test copying a jar
     * 
     * @throws Exception




More information about the jboss-cvs-commits mailing list