Package org.jboss.shrinkwrap.api.spec

Examples of org.jboss.shrinkwrap.api.spec.WebArchive


public class ContainerSecurityTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest.getDeployment()
               .addPackages(true, ServletRoot.class.getPackage())
               .addAsWebInfResource("org/ocpsoft/rewrite/servlet/container/web.xml")
               .addAsWebResource("org/ocpsoft/rewrite/servlet/container/login.html")
               .addAsWebResource("org/ocpsoft/rewrite/servlet/container/login-fail.html")
               .addAsWebResource("org/ocpsoft/rewrite/servlet/container/home.html", "/user/home.html")
View Full Code Here


      return getDeployment("rewrite-test.war");
   }

   public static WebArchive getDeployment(String name)
   {
      WebArchive archive = getDeploymentNoWebXml(name);
      return archive;
   }
View Full Code Here

      return archive;
   }

   public static WebArchive getDeploymentWithCDI()
   {
      WebArchive archive = getDeployment();
      archive.addAsWebInfResource(new StringAsset("<beans/>"), "beans.xml");
      return archive;
   }
View Full Code Here

      return archive;
   }

   public static WebArchive getDeploymentWithFacesAndCDI()
   {
      WebArchive archive = getDeployment();
      archive.addAsWebInfResource(new StringAsset("<beans/>"), "beans.xml");
      archive.addAsWebInfResource(new StringAsset("<faces-config version=\"2.0\"/>"), "faces-config.xml");
      return archive;
   }
View Full Code Here

   public static WebArchive getDeploymentNoWebXml(String name)
   {
      if (isJetty() && "ROOT.war".equals(name))
         name = ".war";

      WebArchive archive = ShrinkWrap
               .create(WebArchive.class, name)
               .addPackages(true, MockBinding.class.getPackage())
               .addAsLibraries(resolveDependencies("org.ocpsoft.logging:logging-api"))
               .addAsLibraries(getRewriteArchive())
               .addAsLibraries(getRewriteConfigArchive())
               .addAsLibraries(getRewriteAnnotationsArchive())
               .addAsLibraries(getContainerArchive())
               .addAsLibraries(getCurrentArchive());

      // Jetty specific stuff
      if (isJetty()) {

         /*
         * Set the EL implementation
         */
         archive.add(new StringAsset("com.sun.el.ExpressionFactoryImpl"),
                  "/WEB-INF/classes/META-INF/services/javax.el.ExpressionFactory");

         /*
         * Set up container configuration
         */
         archive.addAsWebInfResource("jetty-env.xml", "jetty-env.xml");
         archive.addAsWebInfResource("jetty-log4j.xml", "log4j.xml");

      }

      // Tomcat specific stuff
      if (isTomcat()) {

         // setup Weld
         if (isWeld()) {
            archive.addAsLibraries(resolveDependencies("org.jboss.weld:weld-core:1.1.9.Final"));
            archive.addAsLibraries(resolveDependencies("org.jboss.weld.servlet:weld-servlet-core:1.1.9.Final"));
            archive.addAsWebResource("tomcat-weld-context.xml", "META-INF/context.xml");
         }

         // setup OWB
         if (isOWB()) {
            archive.addAsLibraries(resolveDependencies("javax.enterprise:cdi-api:1.0-SP4"));
            archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-impl:1.1.5"));
            archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-web:1.1.5"));
            archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-spi:1.1.5"));
            archive.addAsLibraries(resolveDependencies("org.apache.openwebbeans:openwebbeans-resource:1.1.5"));
            archive.addAsWebResource("tomcat-owb-context.xml", "META-INF/context.xml");
         }

         // setup Mojarra
         archive.addAsLibraries(resolveDependencies("org.glassfish:javax.faces:2.1.13"));
         archive.addAsLibraries(resolveDependencies("javax.servlet:jstl:1.2"));

      }

      return archive;
   }
View Full Code Here

public class HttpRequestParameterTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest.getDeployment()
               .addPackages(true, ServletRoot.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, HttpRequestParameterTestProvider.class);
      return deployment;
   }
View Full Code Here

public class JoinRequestBindingConfigurationTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, ConfigRoot.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, JoinRequestBindingConfigurationProvider.class);
      return deployment;
   }
View Full Code Here

public class RequestConstraintTransformTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, ServletRoot.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, RequestConstraintTransformTestProvider.class);
      return deployment;
   }
View Full Code Here

public class DoubleParameterConfigurationTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest.getDeployment()
               .addPackages(true, ServletRoot.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, DoubleParameterConfigurationTestProvider.class);
      return deployment;
   }
View Full Code Here

public class HttpConfigurationOrder2Test extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, ServletRoot.class.getPackage())
               .addAsWebResource(new StringAsset("test page"), "test.html")
               .addAsWebResource(new StringAsset("index page"), "index.html")
               .addAsServiceProvider(ConfigurationProvider.class, HttpConfigurationOrder2TestProvider.class);
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.spec.WebArchive

Copyright © 2018 www.massapicom. 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.