Package org.jboss.shrinkwrap.api.spec

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


      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
   }
  
   public void testMultipleArchives() throws Exception
   {
      WebArchive war1 = createWar("web1.war", true, ServletWebBean.class);
      DeploymentUnit war1Unit = assertDeploy(war1);
      Deployment war1Deployment = initializeDeploymentBean(war1Unit);
      BeanDeploymentArchive war1BDA = war1Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(war1BDA, "web1.war");
      assertExpectedClasses(war1BDA, ServletWebBean.class);
      Class<?> servletWebBeanWar1Class = getClass(ServletWebBean.class, war1Unit);
     
      WebArchive war2 = createWar("web2.war", true, NotWBJsfBean.class);
      createLib(war2, "crm.jar", false, CrmWebBean.class);
      DeploymentUnit war2Unit = assertDeploy(war2);
      Deployment war2Deployment = initializeDeploymentBean(war2Unit);
      BeanDeploymentArchive war2BDA = war2Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(war2BDA, "web2.war");
      assertExpectedClasses(war2BDA, NotWBJsfBean.class);
      Class<?> notWBJsfBeanWar2Class = getClass(NotWBJsfBean.class, war2Unit);
      Class<?> crmWebBeanWar2Class = getClass(CrmWebBean.class, war2Unit);
     
      JavaArchive ejbJar = createEjbJar("ejb.jar", true, BusinessInterface.class);
      DeploymentUnit ejbJarUnit = assertDeploy(ejbJar);
      Deployment ejbJarDeployment = initializeDeploymentBean(ejbJarUnit);
      BeanDeploymentArchive ejbJarBDA = ejbJarDeployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(ejbJarBDA, "ejb.jar");
      assertExpectedClasses(ejbJarBDA, BusinessInterface.class);
      Class<?> businessInterfaceClass = getClass(BusinessInterface.class, ejbJarUnit);
     
      EnterpriseArchive ear1 = ShrinkWrap.create(EnterpriseArchive.class, "full.ear");
      WebArchive warInEar1 = createWarWithLibs(false, true, true);
      ear1.addModule(warInEar1);
      ear1.addModule(war2);
      JavaArchive ejbJarInEar1 = createEjbJar("ejbInFullEar.jar", false, MySLSBean.class);
      ear1.addModule(ejbJarInEar1);
      createLib(ear1, "lib1.jar", false, ExternalWebBean.class);
View Full Code Here


      return createWar(WAR_NAME, warCDI, ServletWebBean.class);
   }

   protected WebArchive createWar(String warName, boolean warCDI, Class<?>... classes)
   {
      WebArchive war = ShrinkWrap.create(WebArchive.class, warName);
      for (Class<?> clazz: classes)
      {
         war.addClass(clazz);
      }
      MockArchiveManifest.addManifest(war, warCDI);
      return war;
   }
View Full Code Here

      return war;
   }

   protected WebArchive createWarWithLib(boolean warCDI, boolean libCDI)
   {
      WebArchive war = createWar(warCDI);
      createLib(war, "lib.jar", libCDI, UIWebBean.class);
      return war;
   }
View Full Code Here

      return war;
   }

   protected WebArchive createWarWithLibs(boolean warCDI, boolean lib1CDI, boolean lib2CDI)
   {
      WebArchive war = createWar(warCDI);
      createLib(war, "lib1.jar", lib1CDI, UIWebBean.class);
      createLib(war, "lib2.jar", lib2CDI, CrmWebBean.class);
      return war;
   }
View Full Code Here

        public WarDeployment(String archiveName, Package[] pkgs, boolean show) {

            ArchivePath metaInf = ArchivePaths.create("META-INF");


            WebArchive archive = ShrinkWrap.create(WebArchive.class, archiveName);
            for(Package pkg : pkgs) {
                archive.addPackage(pkg);
            }

            File sourceMetaInf = getSourceMetaInfDir(archiveName);
            addFiles(archive, sourceMetaInf, metaInf);

            File sourceWebInf = getSourceWebInfDir(archiveName);
            if (sourceWebInf != null) {
               addFiles(archive, sourceWebInf, ArchivePaths.create("WEB-INF"));
            }

            System.out.println(archive.toString(show));
            realArchive = createArchive(archive);
        }
View Full Code Here

{
   @Deployment(testable = false)
   @ShouldThrowException(DeploymentException.class)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class,
                        SubsetParameterReconfigurationTestProvider.class);
      return deployment;
View Full Code Here

{

   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, LocaleTranspositionConfigurationProvider.class)
               .addAsWebResource(new StringAsset("search page"), "search")
               .addAsWebResource(new StringAsset("library page"), "library")
View Full Code Here

public class ParameterizedOperationTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsWebResource(new StringAsset("exists"), "index.html")
               .addAsServiceProvider(ConfigurationProvider.class, ParameterizedOperationConfigurationProvider.class);
      return deployment;
View Full Code Here

{

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

{

   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest.getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsWebResource(new StringAsset("exists"), "index.html")
               .addAsServiceProvider(ConfigurationProvider.class, NullValueConfigurationProvider.class);
      return deployment;
   }
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.