Package org.jboss.weld.bootstrap.spi

Examples of org.jboss.weld.bootstrap.spi.Deployment


         unit2 = unit1;
         unit1 = temp;
      }
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit1);
      Class<?> notWBJsfBeanClass = getClass(NotWBJsfBean.class, unit2);
      Deployment deployment = initializeDeploymentBean();
     
      BeanDeploymentArchive bda1 = deployment.loadBeanDeploymentArchive(servletWebBeanClass);
      assertBDAId(bda1, "warinear.ear/simple1.war");
      assertExpectedClasses(bda1, ServletWebBean.class);
     
      BeanDeploymentArchive bda2 = deployment.loadBeanDeploymentArchive(notWBJsfBeanClass);
      assertBDAId(bda2, "warinear.ear/simple2.war");
      assertExpectedClasses(bda2, NotWBJsfBean.class);
   }
View Full Code Here


   {
      // ejb.jar
      JavaArchive ejbJar = createEjbJar(true);
      DeploymentUnit unit = assertDeploy(ejbJar);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // simple.war
      WebArchive war = createWar(true);
      unit = assertDeploy(war);
     
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      //Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      //assertCannotLoadBDA(deployment1, servletWebBeanClass);
     
      BeanDeploymentArchive bda = deployment1.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, EJB_JAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
      assertSame(bda, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      // make sure bda contents are unchanged
      assertBDAId(bda, EJB_JAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
   }
View Full Code Here

      {
         warUnit = iterator.next();
      } while (!warUnit.getName().contains(WAR_NAME));
     
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, warUnit);
      Deployment deployment = initializeDeploymentBean();
     
     
      BeanDeploymentArchive bda = deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
     
      bda = deployment.loadBeanDeploymentArchive(servletWebBeanClass);
      assertBDAId(bda, EAR_NAME + "/" + WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class);
   }
View Full Code Here

      JavaArchive ejbJar = createEjbJar(true);
      ear.addModule(ejbJar);
      MockArchiveManifest.addManifest(ear);
      DeploymentUnit unit = assertDeploy(ear);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // simple.war
      WebArchive war = createWar(true);
      unit = assertDeploy(war);
     
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      // Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      //assertCannotLoadBDA(deployment1, servletWebBeanClass);
     
      BeanDeploymentArchive bda = deployment1.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
      assertSame(bda, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      // make sure bda contents are unchanged
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
   }
View Full Code Here

      JavaArchive ejbJar = createEjbJar(true);
      ejbEar.addModule(ejbJar);
      MockArchiveManifest.addManifest(ejbEar);
      DeploymentUnit unit = assertDeploy(ejbEar);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // war.ear
      EnterpriseArchive warEar = ShrinkWrap.create(EnterpriseArchive.class, "war.ear");
      WebArchive war = createWarWithLib(true, false);
      warEar.addModule(war);
      MockArchiveManifest.addManifest(warEar);
      unit = assertDeploy(warEar);
      DeploymentUnit warUnit = unit.getChildren().iterator().next();
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, warUnit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, warUnit);
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      //assertCannotLoadBDA(deployment1, servletWebBeanClass);
     
      BeanDeploymentArchive bda = deployment1.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, "ejb.ear");
      assertExpectedClasses(bda, PlainJavaBean.class);
      assertSame(bda, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      // make sure bda contents are unchanged
      assertBDAId(bda, "ejb.ear");
      assertExpectedClasses(bda, PlainJavaBean.class);
     
      bda = deployment2.loadBeanDeploymentArchive(servletWebBeanClass);
      String bdaName = "war.ear/" + WAR_NAME;
      assertBDAId(bda, bdaName);
      assertExpectedClasses(bda, ServletWebBean.class);
     
      BeanDeploymentArchive bda2 = deployment2.loadBeanDeploymentArchive(uiWebBeanClass);
      assertSame(bda, bda2);
      assertBDAId(bda, bdaName);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
   }
View Full Code Here

  
   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);
      createLib(ear1, "lib2.jar", true, A.class);
      createLib(ear1, "lib3.jar", false, B.class);
      MockArchiveManifest.addManifest(ear1);
      DeploymentUnit ear1Unit = assertDeploy(ear1);
      Deployment ear1Deployment = initializeDeploymentBean(ear1Unit);
      BeanDeploymentArchive ear1BDA = null, ear1War1BDA = null, ear1War2BDA = null;
      for (BeanDeploymentArchive bda: ear1Deployment.getBeanDeploymentArchives())
      {
         if (bda.getId().contains(WAR_NAME))
         {
            ear1War1BDA = bda;
         }
         else if (bda.getId().contains("web2.war"))
         {
            ear1War2BDA = bda;
         }
         else
         {
            ear1BDA = bda;
         }
      }
      assertBDAId(ear1BDA, "full.ear");
      assertExpectedClasses(ear1BDA, A.class);
      assertBDAId(ear1War1BDA, "full.ear/" + WAR_NAME);
      assertExpectedClasses(ear1War1BDA, UIWebBean.class, CrmWebBean.class);
      assertBDAId(ear1War2BDA, "full.ear/web2.war");
      assertExpectedClasses(ear1War2BDA, NotWBJsfBean.class);
      Class<?> servletWebBeanEar1Class = null, uiWebBeanEar1Class = null,
               crmWebBeanEar1War1Class = null, notWBJsfBeanEar1Class = null,
               crmWebBeanEar1War2Class = null;
      for (DeploymentUnit ear1Child: ear1Unit.getChildren())
      {
         if (ear1Child.getName().contains(WAR_NAME))
         {
           servletWebBeanEar1Class = getClass(ServletWebBean.class, ear1Child);
           uiWebBeanEar1Class = getClass(UIWebBean.class, ear1Child);
           crmWebBeanEar1War1Class = getClass(CrmWebBean.class, ear1Child);
         }
         else if (ear1Child.getName().contains("web2.war"))
         {
            notWBJsfBeanEar1Class = getClass(NotWBJsfBean.class, ear1Child);
            crmWebBeanEar1War2Class = getClass(CrmWebBean.class, ear1Child);
         }
      }
      Class<?> externalWebBeanClass = getClass(ExternalWebBean.class, ear1Unit);
      Class<?> aClass = getClass(A.class, ear1Unit);
      Class<?> bClass = getClass(B.class, ear1Unit);
     
      EnterpriseArchive ear2 = ShrinkWrap.create(EnterpriseArchive.class, "ejbWLibs.ear");
      JavaArchive ejbJarInEar2 = createEjbJar("ejbInEar2.jar", true, PlainJavaBean.class);
      ear2.addModule(ejbJarInEar2);
      createLib(ear2, "lib1.jar", false, SomeUtil.class);
      createLib(ear2, "lib2.jar", true, CrmWebBean.class);
      MockArchiveManifest.addManifest(ear2);
      DeploymentUnit ear2Unit = assertDeploy(ear2);
      Deployment ear2Deployment = initializeDeploymentBean(ear2Unit);
      BeanDeploymentArchive ear2BDA = ear2Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(ear2BDA, "ejbWLibs.ear");
      assertExpectedClasses(ear2BDA, PlainJavaBean.class, CrmWebBean.class);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, ear2Unit);
      Class<?> someUtilClass = getClass(SomeUtil.class, ear2Unit);
      Class<?> crmWebBeanClass = getClass(CrmWebBean.class, ear2Unit);
     
      // Assert on web classes
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      /*assertCannotLoadBDA(war1Deployment, servletWebBeanEar1Class);
      assertCannotLoadBDA(war1Deployment, notWBJsfBeanWar2Class);
      assertCannotLoadBDA(war1Deployment, notWBJsfBeanEar1Class);
      assertCannotLoadBDA(war1Deployment, crmWebBeanWar2Class);
      assertCannotLoadBDA(war1Deployment, crmWebBeanEar1War1Class);
      assertCannotLoadBDA(war1Deployment, crmWebBeanEar1War2Class);
      assertCannotLoadBDA(war1Deployment, uiWebBeanEar1Class);*/
      BeanDeploymentArchive bda = war1Deployment.loadBeanDeploymentArchive(servletWebBeanWar1Class);
      assertSame(war1BDA, bda);
      // verify the absence of collateral effects on the BDA
      assertBDAId(war1BDA, "web1.war");
      assertExpectedClasses(war1BDA, ServletWebBean.class);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      /*assertCannotLoadBDA(war2Deployment, servletWebBeanWar1Class);
      assertCannotLoadBDA(war2Deployment, servletWebBeanEar1Class);
      assertCannotLoadBDA(war2Deployment, notWBJsfBeanEar1Class);
      assertCannotLoadBDA(war2Deployment, crmWebBeanEar1War1Class);
      assertCannotLoadBDA(war2Deployment, crmWebBeanEar1War2Class);
      assertCannotLoadBDA(war2Deployment, uiWebBeanEar1Class);*/
      bda = war2Deployment.loadBeanDeploymentArchive(notWBJsfBeanWar2Class);
      bda = war2Deployment.loadBeanDeploymentArchive(crmWebBeanWar2Class);
      assertSame(war2BDA, bda);
      assertBDAId(war2BDA, "web2.war");
      assertExpectedClasses(war2BDA, NotWBJsfBean.class, CrmWebBean.class);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      /*assertCannotLoadBDA(ejbJarDeployment, servletWebBeanWar1Class);
      assertCannotLoadBDA(ejbJarDeployment, servletWebBeanEar1Class);
      assertCannotLoadBDA(ejbJarDeployment, notWBJsfBeanWar2Class);
      assertCannotLoadBDA(ejbJarDeployment, notWBJsfBeanEar1Class);
      assertCannotLoadBDA(ejbJarDeployment, crmWebBeanWar2Class);
      assertCannotLoadBDA(ejbJarDeployment, crmWebBeanEar1War1Class);
      assertCannotLoadBDA(ejbJarDeployment, crmWebBeanEar1War2Class);
      assertCannotLoadBDA(ejbJarDeployment, uiWebBeanEar1Class);
     
      assertCannotLoadBDA(ear1Deployment, servletWebBeanWar1Class);
      assertCannotLoadBDA(ear1Deployment, notWBJsfBeanWar2Class);
      assertCannotLoadBDA(ear1Deployment, crmWebBeanWar2Class);*/
      bda = ear1Deployment.loadBeanDeploymentArchive(servletWebBeanEar1Class);
      assertSame(ear1War1BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(uiWebBeanEar1Class);
      assertSame(ear1War1BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(crmWebBeanEar1War1Class);
      assertSame(ear1War1BDA, bda);
      assertBDAId(ear1War1BDA, "full.ear/" + WAR_NAME);
      assertExpectedClasses(ear1War1BDA, ServletWebBean.class, UIWebBean.class, CrmWebBean.class);
     
      bda = ear1Deployment.loadBeanDeploymentArchive(notWBJsfBeanEar1Class);
      assertSame(ear1War2BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(crmWebBeanEar1War2Class);
      assertSame(ear1War2BDA, bda);
      assertBDAId(ear1War2BDA, "full.ear/web2.war");
      assertExpectedClasses(ear1War2BDA, NotWBJsfBean.class, CrmWebBean.class);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      /*assertCannotLoadBDA(ear2Deployment, servletWebBeanWar1Class);
      assertCannotLoadBDA(ear2Deployment, servletWebBeanEar1Class);
      assertCannotLoadBDA(ear2Deployment, notWBJsfBeanWar2Class);
      assertCannotLoadBDA(ear2Deployment, notWBJsfBeanEar1Class);
      assertCannotLoadBDA(ear2Deployment, crmWebBeanWar2Class);
      assertCannotLoadBDA(ear2Deployment, crmWebBeanEar1War1Class);
      assertCannotLoadBDA(ear2Deployment, crmWebBeanEar1War2Class);
      assertCannotLoadBDA(ear2Deployment, uiWebBeanEar1Class);*/
     
      // Assert on business classes that are part of existing BDAs
      bda = ejbJarDeployment.loadBeanDeploymentArchive(businessInterfaceClass);
      assertSame(ejbJarBDA, bda);
      war1Deployment.loadBeanDeploymentArchive(businessInterfaceClass);
      assertSame(ejbJarBDA, bda);
      war2Deployment.loadBeanDeploymentArchive(businessInterfaceClass);
      assertSame(ejbJarBDA, bda);
      ear1Deployment.loadBeanDeploymentArchive(businessInterfaceClass);
      assertSame(ejbJarBDA, bda);
      war2Deployment.loadBeanDeploymentArchive(businessInterfaceClass);
      assertSame(ejbJarBDA, bda);
      assertBDAId(ejbJarBDA, "ejb.jar"); // no collateral effects on the BDA
      assertExpectedClasses(ejbJarBDA, BusinessInterface.class);
     
      bda = ear1Deployment.loadBeanDeploymentArchive(aClass);
      assertSame(ear1BDA, bda);
      bda = war1Deployment.loadBeanDeploymentArchive(aClass);
      assertSame(ear1BDA, bda);
      bda = war2Deployment.loadBeanDeploymentArchive(aClass);
      assertSame(ear1BDA, bda);
      bda = ejbJarDeployment.loadBeanDeploymentArchive(aClass);
      assertSame(ear1BDA, bda);
      bda = ear2Deployment.loadBeanDeploymentArchive(aClass);
      assertSame(ear1BDA, bda);
      assertBDAId(ear1BDA, "full.ear"); // no collateral effects on the BDA
      assertExpectedClasses(ear1BDA, A.class);
     
      bda = ear2Deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertSame(ear2BDA, bda);
      bda = ear2Deployment.loadBeanDeploymentArchive(crmWebBeanClass);
      assertSame(ear2BDA, bda);
      bda = war1Deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertSame(ear2BDA, bda);
      bda = war1Deployment.loadBeanDeploymentArchive(crmWebBeanClass);
      assertSame(ear2BDA, bda);
      bda = war2Deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertSame(ear2BDA, bda);
      bda = war2Deployment.loadBeanDeploymentArchive(crmWebBeanClass);
      assertSame(ear2BDA, bda);
      bda = ejbJarDeployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertSame(ear2BDA, bda);
      bda = ejbJarDeployment.loadBeanDeploymentArchive(crmWebBeanClass);
      assertSame(ear2BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertSame(ear2BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(crmWebBeanClass);
      assertSame(ear2BDA, bda);
      assertBDAId(ear2BDA, "ejbWLibs.ear"); // no collateral effects on the BDA
      assertExpectedClasses(ear2BDA, PlainJavaBean.class, CrmWebBean.class);
     
      // Assert on business classes that are not yet part of existing BDAs
      bda = war1Deployment.loadBeanDeploymentArchive(externalWebBeanClass);
      assertSame(ear1BDA, bda);
      assertBDAId(ear1BDA, "full.ear");
      assertExpectedClasses(ear1BDA, ExternalWebBean.class, A.class);
      bda = war2Deployment.loadBeanDeploymentArchive(externalWebBeanClass);
      assertSame(ear1BDA, bda);
      bda = ejbJarDeployment.loadBeanDeploymentArchive(externalWebBeanClass);
      assertSame(ear1BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(externalWebBeanClass);
      assertSame(ear1BDA, bda);
      bda = ear2Deployment.loadBeanDeploymentArchive(externalWebBeanClass);
      assertSame(ear1BDA, bda);
      assertBDAId(ear1BDA, "full.ear"); // no collateral effects on the BDA
      assertExpectedClasses(ear1BDA, ExternalWebBean.class, A.class);
     
      bda = ear1Deployment.loadBeanDeploymentArchive(bClass);
      assertSame(ear1BDA, bda);
      assertBDAId(ear1BDA, "full.ear");
      assertExpectedClasses(ear1BDA, ExternalWebBean.class, A.class, B.class);
      bda = war1Deployment.loadBeanDeploymentArchive(bClass);
      assertSame(ear1BDA, bda);
      bda = war2Deployment.loadBeanDeploymentArchive(bClass);
      assertSame(ear1BDA, bda);
      bda = ejbJarDeployment.loadBeanDeploymentArchive(bClass);
      assertSame(ear1BDA, bda);
      bda = ear2Deployment.loadBeanDeploymentArchive(bClass);
      assertSame(ear1BDA, bda);
      assertBDAId(ear1BDA, "full.ear"); // no collateral effects on the BDA
      assertExpectedClasses(ear1BDA, ExternalWebBean.class, A.class, B.class);

      bda = ejbJarDeployment.loadBeanDeploymentArchive(someUtilClass);
      assertSame(ear2BDA, bda);
      assertBDAId(ear2BDA, "ejbWLibs.ear");
      assertExpectedClasses(ear2BDA, PlainJavaBean.class, SomeUtil.class, CrmWebBean.class);
      bda = war1Deployment.loadBeanDeploymentArchive(someUtilClass);
      assertSame(ear2BDA, bda);
      bda = war2Deployment.loadBeanDeploymentArchive(someUtilClass);
      assertSame(ear2BDA, bda);
      bda = ear1Deployment.loadBeanDeploymentArchive(someUtilClass);
      assertSame(ear2BDA, bda);
      bda = ear2Deployment.loadBeanDeploymentArchive(someUtilClass);
      assertSame(ear2BDA, bda);
      assertBDAId(ear2BDA, "ejbWLibs.ear"); // no collateraleffects on the BDA
      assertExpectedClasses(ear2BDA, PlainJavaBean.class, SomeUtil.class, CrmWebBean.class);
   }
View Full Code Here

   {
      // ejb1.jar
      JavaArchive ejbJar1 = createEjbJar("ejb1.jar", true, PlainJavaBean.class);
      DeploymentUnit unit = assertDeploy(ejbJar1);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
     
      // ejb2.jar
      JavaArchive ejbJar2 = createEjbJar("ejb2.jar", true,  MySLSBean.class, BusinessInterface.class);
      unit = assertDeploy(ejbJar2);
      Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
      Class<?> businessInterface = getClass(BusinessInterface.class, unit);
      Deployment deployment2 =  initializeDeploymentBean(unit);
     
      assertNotSame(deployment1, deployment2);
     
      BeanDeploymentArchive bda1 = deployment1.getBeanDeploymentArchives().iterator().next();
      BeanDeploymentArchive bda2 = deployment2.getBeanDeploymentArchives().iterator().next();
      // double invocation should yield the same result
      assertSame(bda1, deployment1.loadBeanDeploymentArchive(plainJavaBeanClass));
      assertSame(bda1, deployment1.loadBeanDeploymentArchive(plainJavaBeanClass));
     
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(businessInterface));
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(businessInterface));
     
      assertSame(bda1, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      assertSame(bda1, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(businessInterface));
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(businessInterface));
   }
View Full Code Here

      try
      {
         assertBean(DeployersUtils.getBootstrapBeanName(topUnit), null, Object.class);

         Object bean = getBean(Deployment.class);
         Deployment deployment = assertInstanceOf(bean, Deployment.class, false);
         initializeDeployment(deployment);
        
         List<BeanDeploymentArchive> archives = new ArrayList<BeanDeploymentArchive>();
         getArchives(archives, deployment.getBeanDeploymentArchives());
         assertEquals(getExpectedArchives(), archives.size());

         //List<BeansXml> urls = new ArrayList<BeansXml>();
         List<String> classes = new ArrayList<String>();
         for (BeanDeploymentArchive bad : archives)
         {
            //urls.add(bad.getBeansXml());
            for (String clazz : bad.getBeanClasses())
               classes.add(clazz);
         }

         Set<String> expected = new HashSet<String>();
//         addExpectedResource(expected, "ejbs.jar");
//         addExpectedResource(expected, "ext.jar");
//         addExpectedResource(expected, "simple.jar");
//         addExpectedResource(expected, "ui.jar");
//         addExpectedResource(expected, "crm.jar");
//         addExpectedResource(expected, "simple.war", "/WEB-INF/beans.xml");
//
//         assertEquals("Illegal size or urls.", expected.size(), urls.size());

//         for (URL url : urls)
//         {
//            boolean found = false;
//            Iterator<String> iter = expected.iterator();
//            while (iter.hasNext())
//            {
//               String expectedURL = iter.next();
//               if (url.toExternalForm().contains(expectedURL))
//               {
//                  iter.remove();
//                  found = true;
//                  break;
//               }
//            }
//            assertTrue("Unexpected wb url: " + url, found);
//         }

         addExpectedClass(expected, BusinessInterface.class);
         addExpectedClass(expected, MySLSBean.class);
         addExpectedClass(expected, ExternalWebBean.class);
         addExpectedClass(expected, PlainJavaBean.class);
         addExpectedClass(expected, UIWebBean.class);
         addExpectedClass(expected, ServletWebBean.class);
         addExpectedClass(expected, CrmWebBean.class);

         assertEquals("Illegal size or classes.", classes.size(), expected.size());

         for (String className : classes)
            assertTrue(expected.remove(className));

         assertEmpty("Should be emtpy, missing " + expected, expected);

         Class<?> newBeanClass = topUnit.getClassLoader().loadClass("org.jboss.test.deployers.support.MockTransactionServices");
         BeanDeploymentArchive newBDA = deployment.loadBeanDeploymentArchive(newBeanClass);
         assertNewBeanDeploymentArchive(archives, newBDA);
      }
      finally
      {
         undeploy(topUnit);
View Full Code Here

    public WeldBootstrap() {
    }

    @Override
    protected Deployment createDeployment(ResourceLoader resourceLoader, Bootstrap bootstrap) {
        Deployment deployment = super.createDeployment(resourceLoader, bootstrap);
        return deployment;
    }
View Full Code Here

public class ModularWeld extends Weld
{
   @Override
   protected Deployment createDeployment(final ResourceLoader resourceLoader, final Bootstrap bootstrap)
   {
      Deployment deployment = super.createDeployment(resourceLoader, bootstrap);

      Collection<BeanDeploymentArchive> archives = deployment.getBeanDeploymentArchives();

      return deployment;
   }
View Full Code Here

TOP

Related Classes of org.jboss.weld.bootstrap.spi.Deployment

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.