Package org.jboss.shrinkwrap.api.spec

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


        earLib.addAsManifestResource(EmptyAsset.INSTANCE, "emptyJarLibResource.properties");
        earLib.addAsManifestResource(EmptyAsset.INSTANCE, "properties/nestedJarLib.properties");
        ear.addAsLibraries(earLib);

        WebArchive war = ShrinkWrap.create(WebArchive.class, INNER_WAR_ARCHIVE_NAME);
        war.addClass(TestA.class);
        war.add(EmptyAsset.INSTANCE, "META-INF/example.txt");
        war.add(EmptyAsset.INSTANCE, "META-INF/properties/nested.properties");
        war.add(EmptyAsset.INSTANCE, "example2.txt");
        war.addAsResource(EarResourceListingTestCase.class.getPackage(), "TextFile1.txt", "TextFile1.txt");
        war.addAsWebInfResource(EarResourceListingTestCase.class.getPackage(), "web.xml", "web.xml");
View Full Code Here


    static final String DS_CLEAR_TEXT_PASSWORD = "sa";

    @Deployment
    public static WebArchive deploy() {
        WebArchive war = ShrinkWrap.create(WebArchive.class, "passwordMasking" + ".war");
        war.addClass(PasswordMaskingTestServlet.class);
        war.setWebXML(PasswordMaskingInContainerTestCase.class.getPackage(), "web.xml");
        return war;
    }

    /**
 
View Full Code Here

        final JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
        jarOne.addClass(MessageBean.class);
        ear.addAsModule(new ArchiveAsset(jarOne, ZipExporter.class), "subdir/ejb/ejb.jar");

        final WebArchive war = ShrinkWrap.create(WebArchive.class, "web.war");
        war.addClass(MessageServlet.class);
        ear.addAsModule(new ArchiveAsset(war, ZipExporter.class), "subdir/web/web.war");

        logger.info(ear.toString(true));
        return ear;
    }
View Full Code Here

    @Deployment
    public static WebArchive createDeployment() {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, "anonymous-pojo-usecase1.war");
        war.addPackage(AnonymousPOJO.class.getPackage());
        war.addClass(AnonymousPOJO.class);
        war.addAsWebInfResource(AnonymousPOJO.class.getPackage(),"web.xml","web.xml");
        log.info(war.toString(true));
        return war;
    }
View Full Code Here

    URL baseUrl;

    protected static WebArchive createWAR(final Class<?> beanClass, final String warDeploymentUnitName) {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, warDeploymentUnitName);

        war.addClass(beanClass);

        war.addAsWebResource(ContextRootTestBase.class.getPackage(), "index.html", "index.html");

        war.addAsWebInfResource(ContextRootTestBase.class.getPackage(), "beans.xml", "beans.xml");
        war.addAsWebInfResource(ContextRootTestBase.class.getPackage(), "faces-config.xml", "faces-config.xml");
View Full Code Here

   @Deployment
   public static WebArchive deploy(){
      //Utils.stop();

      WebArchive war = ShrinkWrap.create(WebArchive.class, "passwordMasking" + ".war");
      war.addClass(PasswordMaskingTestServlet.class);
      war.setWebXML(PasswordMaskingTestCase.class.getPackage(), "web.xml");

      return war;
   }
View Full Code Here

    @Deployment
    public static WebArchive createDeployment() {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-endpoint-example.war");
        war.addPackage(SimpleWebserviceEndpointImpl.class.getPackage());
        war.addClass(SimpleWebserviceEndpointImpl.class);
        war.addAsWebInfResource(SimpleWebserviceEndpointTestCase.class.getPackage(),"web.xml","web.xml");
        log.info(war.toString(true));
        return war;
    }
View Full Code Here

    @Deployment
    public static WebArchive createDeployment() {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, "anonymous-pojo-usecase2.war");
        war.addPackage(AnonymousPOJO.class.getPackage());
        war.addClass(AnonymousPOJO.class);
        log.info(war.toString(true));
        return war;
    }

    @Test
View Full Code Here

        return jar;
    }

    private static WebArchive createWar(final String warName) {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, warName + ".war");
        war.addClass(PolicyContextTestServlet.class);
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(war.toString(true));
        }
        return war;
    }
View Full Code Here

        final WebArchive war = ShrinkWrap.create(WebArchive.class, WEB_APP_CONTEXT_TWO + ".war");
        war.addClasses(HelloWorldServlet.class, EjbInvokingServlet.class);

        final WebArchive otherWar = ShrinkWrap.create(WebArchive.class, OTHER_WEB_APP_CONTEXT + ".war");
        otherWar.addClass(ServletInOtherWar.class);

        // TODO: Currently, due to an issue in AS7 integration with Arquillian, the web-app context and the
        // .ear name should be the same or else you run into test deployment failures like:
        // Caused by: java.lang.IllegalStateException: Error launching test at
        // http://127.0.0.1:8080/<earname>/ArquillianServletRunner?outputMode=serializedObject&className=org.jboss.as.test.spec.ear.classpath.unit.SubDeploymentAvailableInClassPathTestCase&methodName=testEjbClassAvailableInServlet. Kept on getting 404s.
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.