[jboss-cvs] JBossAS SVN: r58625 - 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 Nov 19 01:26:19 EST 2006


Author: scott.stark at jboss.org
Date: 2006-11-19 01:26:16 -0500 (Sun, 19 Nov 2006)
New Revision: 58625

Modified:
   projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
Log:
Add tests of vfs access when the vfs path contains spaces

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-11-19 03:40:16 UTC (rev 58624)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java	2006-11-19 06:26:16 UTC (rev 58625)
@@ -930,6 +930,40 @@
    }
 
    /**
+    * Validate accessing an packed jar vf and its uri when the vfs path
+    * contains spaces
+    * @throws Exception
+    */
+   public void testJarWithSpacesInPath()
+      throws Exception
+   {
+      URL rootURL = getResource("/vfs/test");
+      VFS vfs = VFS.getVFS(rootURL);
+      VirtualFile tstjar = vfs.findChild("path with spaces/tst.jar");
+      assertNotNull("tstjar != null", tstjar);
+      URI uri = tstjar.toURI();
+      URI expectedURI = new URI(rootURL.toString()+"/path%20with%20spaces/tst.jar");
+      assertEquals(uri, expectedURI);
+   }
+
+   /**
+    * Validate accessing an unpacked jar vf and its uri when the vfs path
+    * contains spaces
+    * @throws Exception
+    */
+   public void testUnpackedJarWithSpacesInPath()
+      throws Exception
+   {
+      URL rootURL = getResource("/vfs/test");
+      VFS vfs = VFS.getVFS(rootURL);
+      VirtualFile tstjar = vfs.findChild("path with spaces/unpacked-tst.jar");
+      assertNotNull("tstjar != null", tstjar);
+      URI uri = tstjar.toURI();
+      URI expectedURI = new URI(rootURL.toString()+"/path%20with%20spaces/unpacked-tst.jar/");
+      assertEquals(uri, expectedURI);
+   }
+
+   /**
     * Tests that we can find the META-INF/some-data.xml in an unpacked deployment
     */
    public void testGetMetaDataUnpackedJar() throws Exception




More information about the jboss-cvs-commits mailing list