Package org.jboss.virtual

Examples of org.jboss.virtual.VFS.findChild()


   public void testManifestClasspath()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile outerjar = vfs.findChild("outermf.jar");
      assertNotNull("outermf.jar != null", outerjar);

      ArrayList<VirtualFile> cp = new ArrayList<VirtualFile>();
      VFSUtils.addManifestLocations(outerjar, cp);
      // The p0.jar should be found in the classpath
View Full Code Here


   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("vfs"+rootURL.toString()+"/path%20with%20spaces/tst.jar/");
      assertEquals(expectedURI.getPath(), uri.getPath());
View Full Code Here

      assertEquals(expectedURI.getPath(), uri.getPath());

      InputStream is = uri.toURL().openStream();
      is.close();

      tstjar = vfs.findChild("path with spaces/tst%20nospace.jar");
      assertNotNull("tstjar != null", tstjar);
      uri = tstjar.toURI();
      expectedURI = new URI("vfs"+rootURL.toString()+"/path%20with%20spaces/tst%2520nospace.jar/");
      assertEquals(expectedURI.getPath(), uri.getPath());
View Full Code Here

    */
   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("vfs" + rootURL.toString()+"/path%20with%20spaces/unpacked-tst.jar/");
      assertEquals(uri, expectedURI);
   }
View Full Code Here

   private void testGetMetaDataFromJar(String name) throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
     
      VirtualFile jar = vfs.findChild(name);
      assertNotNull(jar);
      VirtualFile metadataLocation = jar.findChild("META-INF");
      assertNotNull(metadataLocation);

      VirtualFile metadataByName = metadataLocation.findChild("some-data.xml");
View Full Code Here

      File tmp = File.createTempFile("testFileExists", null, tmpRoot);
      log.info("+++ testFileExists, tmp="+tmp.getCanonicalPath());

      URL rootURL = tmpRoot.toURI().toURL();
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tmpVF = vfs.findChild(tmp.getName());
      assertTrue(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertTrue("tmp.delete()", tmpVF.delete());
      assertFalse(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertTrue(tmpRoot+".delete()", tmpRoot.delete());
   }
View Full Code Here

      assertTrue(tmp+".mkdir()", tmp.mkdir());
      log.info("+++ testDirFileExists, tmp="+tmp.getCanonicalPath());

      URL rootURL = tmpRoot.toURI().toURL();
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tmpVF = vfs.findChild(tmp.getName());
      assertTrue(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertFalse(tmpVF.getPathName()+".isLeaf()", tmpVF.isLeaf());
      assertTrue(tmp+".delete()", tmp.delete());
      assertFalse(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertTrue(tmpRoot+".delete()", tmpRoot.delete());
View Full Code Here

      jos.setLevel(0);
      jos.close();

      URL rootURL = tmpRoot.toURI().toURL();
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tmpVF = vfs.findChild(tmpJar.getName());
      assertTrue(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertTrue(tmpVF.getPathName()+".size() > 0", tmpVF.getSize() > 0);
      assertTrue("tmp.delete()", tmpVF.delete());
      assertFalse(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertTrue(tmpRoot+".delete()", tmpRoot.delete());
View Full Code Here

      assertTrue(tmp+".mkdir()", tmp.mkdir());
      log.info("+++ testDirJarExists, tmp="+tmp.getCanonicalPath());

      URL rootURL = tmpRoot.toURI().toURL();
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile tmpVF = vfs.findChild(tmp.getName());
      log.info(tmpVF);
      assertTrue(tmpVF.getPathName()+".exists()", tmpVF.exists());
      assertFalse(tmpVF.getPathName()+".isLeaf()", tmpVF.isLeaf());
      assertTrue(tmp+".delete()", tmp.delete());
      assertFalse(tmpVF.getPathName()+".exists()", tmpVF.exists());
View Full Code Here

   @SuppressWarnings("deprecation")
   public void testEqualsOnEmptyPath() throws Exception
   {
      URL rootURL = getResource("/vfs/test/interop_W2JREMarshallTest_appclient_vehicle.ear");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile file = vfs.findChild("interop_W2JREMarshallTest_appclient_vehicle_client.jar");
      VirtualFile same = file.findChild("");
      assertEquals(file, same);
   }

   /** All of the following entries should be seen
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.