Package org.jboss.virtual

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


      throws Exception
   {
      // this expects to be run with a working dir of the container root
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile inner = vfs.findChild("outer.jar/jar1.jar");

      File vfsSer = File.createTempFile("testVFNestedJarSerialization", ".ser");
      vfsSer.deleteOnExit();
      // Write out the vfs inner jar file
      FileOutputStream fos = new FileOutputStream(vfsSer);
View Full Code Here


      assertTrue("jar1.jar children.length("+contents.size()+") >= 2", contents.size() >= 2);
      for(VirtualFile vf : contents)
      {
         log.info("  "+vf.getName());
      }
      VirtualFile vf = vfs.findChild("outer.jar/jar1.jar");
      VirtualFile jar1MF = vf.findChild("META-INF/MANIFEST.MF");
      InputStream mfIS = jar1MF.openStream();
      Manifest mf = new Manifest(mfIS);
      Attributes mainAttrs = mf.getMainAttributes();
      String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_TITLE);
View Full Code Here

      File vfsRoot = linkFile.getParentFile();
      assertNotNull("vfs/links/war1.vfslink.properties", linkURL);
      VFS vfs = VFS.getVFS(vfsRoot.toURI());

      // We should find the test-link.war the link represents
      VirtualFile war = vfs.findChild("test-link.war");
      assertNotNull("war", war);

      // Validate the WEB-INF/classes child link
      VirtualFile classes = war.findChild("WEB-INF/classes");
      String classesName = classes.getName();
View Full Code Here

   public void testDirURLs() throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);

      VirtualFile outerJar = vfs.findChild("unpacked-outer.jar");
      URL outerURL = outerJar.toURL();
      log.debug("outerURL: "+outerURL);
      assertTrue(outerURL+" ends in '/'", outerURL.getPath().endsWith("/"));
      // Validate that jar1 is under unpacked-outer.jar
      URL jar1URL = new URL(outerURL, "jar1.jar");
View Full Code Here

      assertTrue("jar1URL path ends in unpacked-outer.jar/jar1.jar!/",
            jar1URL.getPath().endsWith("unpacked-outer.jar/jar1.jar"));
      VirtualFile jar1 = outerJar.findChild("jar1.jar");
      assertEquals(jar1URL, jar1.toURL());

      VirtualFile packedJar = vfs.findChild("jar1.jar");
      jar1URL = packedJar.findChild("org/jboss/test/vfs/support").toURL();
      assertTrue("Jar directory entry URLs must end in /: " + jar1URL.toString(), jar1URL.toString().endsWith("/"));
   }

   /**
 
View Full Code Here

   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");
View Full Code Here

      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("/"));
   }
View Full Code Here

   public void testCopyJar()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile jar = vfs.findChild("outer.jar");
      assertTrue("outer.jar != null", jar != null);
      File tmpJar = File.createTempFile("testCopyJar", ".jar");
      tmpJar.deleteOnExit();

      try
View Full Code Here

   public void testCopyInnerJar()
      throws Exception
   {
      URL rootURL = getResource("/vfs/test");
      VFS vfs = VFS.getVFS(rootURL);
      VirtualFile outerjar = vfs.findChild("outer.jar");
      assertTrue("outer.jar != null", outerjar != null);
      VirtualFile jar = outerjar.findChild("jar1.jar");
      assertTrue("outer.jar/jar1.jar != null", jar != null);

      File tmpJar = File.createTempFile("testCopyInnerJar", ".jar");
View Full Code Here

   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

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.