Package org.jboss.virtual

Examples of org.jboss.virtual.VirtualFile.toURL()


      VirtualFile jar = vfs.findChild("jar1-filesonly.jar");
      assertTrue("jar1-filesonly.jar != null", jar != null);

      VirtualFile metaInf = jar.findChild("META-INF/MANIFEST.MF");
      assertTrue("META-INF/MANIFEST.MF != null", metaInf != null);
      InputStream mfIS = metaInf.toURL().openStream();
      assertTrue("META-INF/MANIFEST.MF.openStream != null", mfIS != null);
      Manifest mf = new Manifest(mfIS);
      Attributes mainAttrs = mf.getMainAttributes();
      String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
      assertEquals("1.0.0.GA", version);
View Full Code Here


      assertEquals("1.0.0.GA", version);
      String title = mf.getMainAttributes().getValue(Attributes.Name.SPECIFICATION_TITLE);
      assertEquals("jar1-filesonly", title);
      mfIS.close();

      String urlString = metaInf.toURL().toString();
      URL mfURL = new URL(urlString);
      mfIS = mfURL.openStream();
      assertTrue("META-INF/MANIFEST.MF.openStream != null", mfIS != null);
      mf = new Manifest(mfIS);
      mainAttrs = mf.getMainAttributes();
View Full Code Here

      assertTrue("ClassInJar1.class != null", ClassInJar1 != null);
      assertTrue("ClassInJar1.class is a leaf", ClassInJar1.isLeaf());

      VirtualFile metaInf = war.findChild("META-INF/MANIFEST.MF");
      assertTrue("META-INF/MANIFEST.MF != null", metaInf != null);
      InputStream mfIS = metaInf.toURL().openStream();
      assertTrue("META-INF/MANIFEST.MF.openStream != null", mfIS != null);
      Manifest mf = new Manifest(mfIS);
      Attributes mainAttrs = mf.getMainAttributes();
      String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
      assertEquals("1.0.0.GA", version);
View Full Code Here

      assertTrue("filesonly.war != null", war != null);

      VirtualFile classes = war.findChild("WEB-INF/classes");
      assertTrue("WEB-INF/classes != null", classes != null);
      HashSet<String> names = new HashSet<String>();
      ClassPathIterator iter = new ClassPathIterator(classes.toURL());
      ClassPathEntry entry = null;
      while( (entry = iter.getNextEntry()) != null )
      {
         names.add(entry.name);
      }
View Full Code Here

      {
         log.info("  "+vf.getName());
      }
      VirtualFile vf = vfs.findChild("outer.jar/jar1.jar");
      VirtualFile jar1MF = vf.findChild("META-INF/MANIFEST.MF");
      InputStream mfIS = jar1MF.toURL().openStream();
      Manifest mf = new Manifest(mfIS);
      Attributes mainAttrs = mf.getMainAttributes();
      String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_TITLE);
      assertEquals(Attributes.Name.SPECIFICATION_TITLE.toString(), "jar1", version);
      mfIS.close();
View Full Code Here

      log.debug("size: "+size);
      assertEquals("name", name, tmpVF.getName());
      assertEquals("pathName", vfsPath, tmpVF.getPathName());
      assertEquals("lastModified", lastModified, tmpVF.getLastModified());
      assertEquals("size", size, tmpVF.getSize());
      assertEquals("url", url, tmpVF.toURL());
      assertEquals("isLeaf", true, tmpVF.isLeaf());
      assertEquals("isHidden", false, tmpVF.isHidden());

      // Read in the VF from the serialized file
      FileInputStream fis = new FileInputStream(tmp);
View Full Code Here

      // Validated the deserialized attribtes against the tmp file
      assertEquals("name", name, tmpVF2.getName());
      assertEquals("pathName", vfsPath, tmpVF2.getPathName());
      assertEquals("lastModified", lastModified, tmpVF2.getLastModified());
      assertEquals("size", size, tmpVF2.getSize());
      assertEquals("url", url, tmpVF2.toURL());
      assertEquals("isLeaf", true, tmpVF2.isLeaf());
      assertEquals("isHidden", false, tmpVF2.isHidden());
   }

   /**
 
View Full Code Here

      log.debug("size: "+size);
      assertEquals("name", name, tmpVF.getName());
      assertEquals("pathName", vfsPath, tmpVF.getPathName());
      assertEquals("lastModified", lastModified, tmpVF.getLastModified());
      assertEquals("size", size, tmpVF.getSize());
      assertEquals("url", url.getPath(), tmpVF.toURL().getPath());
      // TODO: these should pass
      //assertEquals("isFile", true, tmpVF.isFile());
      //assertEquals("isDirectory", false, tmpVF.isDirectory());
      assertEquals("isHidden", false, tmpVF.isHidden());
      // Write out the vfs jar file
View Full Code Here

      // Validate the vf jar against the tmp file attributes
      assertEquals("name", name, tmpVF2.getName());
      assertEquals("pathName", vfsPath, tmpVF2.getPathName());
      assertEquals("lastModified", lastModified, tmpVF2.getLastModified());
      assertEquals("size", size, tmpVF2.getSize());
      assertEquals("url", url.getPath(), tmpVF2.toURL().getPath());
      // TODO: these should pass
      //assertEquals("isFile", true, tmpVF2.isFile());
      //assertEquals("isDirectory", false, tmpVF2.isDirectory());
      assertEquals("isHidden", false, tmpVF2.isHidden());
   }
View Full Code Here

            "META-INF/persistence.xml"
      };

      URL [] classesURLs = new URL []
      {
         classes.toURL(),
         new URL(classes.toURL() + "?" + VFSUtils.USE_COPY_QUERY + "=true")
      };

      for (URL url: classesURLs)
      {
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.