Package org.jboss.shrinkwrap.api.spec

Examples of org.jboss.shrinkwrap.api.spec.WebArchive.addAsLibrary()


    public static WebArchive deployment() {
        BeansXml beansXml = new BeansXml();
        beansXml.interceptors(SimpleInterceptor.class);
        WebArchive war = baseDeployment(beansXml).addClasses(DuplicateBeansXmlMergingTestBase.class, SimpleBinding.class, SimpleInterceptor.class);
        JavaArchive library = ShrinkWrap.create(JavaArchive.class, "library.jar").addAsManifestResource(beansXml, "beans.xml");
        war.addAsLibrary(library);
        return war;
    }

    @Test
    public void testDuplicatesInSingleFileAreNotRemoved() {
View Full Code Here


      .addClasses(TestResource.class, TestReader.class)
      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
      .addAsServiceProvider(Extension.class, BostonBeanExtension.class);
     
      JavaArchive jar = ShrinkWrap.create(JavaArchive.class).addClasses(BostonHolder.class, BostonlLeaf.class);
      war.addAsLibrary(jar);
      System.out.println(war.toString(true));
      return war;
   }

   @Test
View Full Code Here

            final Set<String> components = new HashSet<String>();
            for (Map.Entry<String, File> entry : artifacts.entrySet()) {
                String name = entry.getKey();
                File f = entry.getValue();
                if (!isWar(name, f)) {
                    archive.addAsLibrary(f);
                    Manifest mf = readManifest(f);
                    if (mf.getMainAttributes().containsKey(new Attributes.Name(SERVICE_COMPONENT))) {
                        String serviceComponents = mf.getMainAttributes().getValue(SERVICE_COMPONENT);
                        for (String component : Strings.splitAndTrimAsList(serviceComponents, ",")) {
                            if (VALID_COMPONENT_PATH_PATTERN.matcher(component).matches()) {
View Full Code Here

  public static WebArchive createDeployment() throws Exception {
    File f = new File(ServletMetaModelPlugin.class.getProtectionDomain().getCodeSource().getLocation().toURI());
    WebArchive war = createServletDeployment(true, "plugin.servlet.base");
    war.addAsResource(new StringAsset("abc=def"), "bundle.properties");
    war.delete("WEB-INF/web.xml");
    war.addAsLibrary(f);
    return war;
  }

  @Drone
  WebDriver driver;
View Full Code Here

    doTestImport(new ClassLoaderFactory() {
      @Override
      public ClassLoader getClassLoader(final JavaArchive jar) throws Exception {
        WebArchive war = ShrinkWrap.create(WebArchive.class);
        war.setManifest(Thread.currentThread().getContextClassLoader().getResource("META-INF/MANIFEST.MF"));
        war.addAsLibrary(jar);
        final File tmp = File.createTempFile("crash", ".war");
        assertTrue(tmp.delete());
        war.as(ZipExporter.class).exportTo(tmp);
        final byte[] bytes = Utils.readAsBytes(jar.get("foo/A.class").getAsset().openStream());
        return new ClassLoader(Thread.currentThread().getContextClassLoader()) {
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.