Package org.jboss.weld.bootstrap.spi

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


   {
      // 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", false,  MySLSBean.class, BusinessInterface.class);
      unit = assertDeploy(ejbJar2);
      ClassLoader classLoader2 = unit.getClassLoader();
      Class<?> mySLSBeanClass = classLoader2.loadClass(MySLSBean.class.getName());
      Class<?> businessInterface = classLoader2.loadClass(BusinessInterface.class.getName());
     
      BeanDeploymentArchive bda1 = deployment1.getBeanDeploymentArchives().iterator().next();
      assertSame(bda1, deployment1.loadBeanDeploymentArchive(plainJavaBeanClass));
      // creation of bda2 on demand
      BeanDeploymentArchive bda2 = deployment1.loadBeanDeploymentArchive(mySLSBeanClass);
      assertBDAId(bda2, "ejb2.jar");
      assertExpectedClasses(bda2, MySLSBean.class);
      assertNoBeansXml(bda2);
      // double invocation
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(mySLSBeanClass));
      assertBDAId(bda2, "ejb2.jar");
      assertExpectedClasses(bda2, MySLSBean.class);
      assertNoBeansXml(bda2);
      // inclusion of BusinessInterface
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(businessInterface));
      assertBDAId(bda2, "ejb2.jar");
      assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
      assertNoBeansXml(bda2);
      // double invocation
      assertSame(bda2, deployment1.loadBeanDeploymentArchive(businessInterface));
      assertBDAId(bda2, "ejb2.jar");
      assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
      assertNoBeansXml(bda2);
   }
View Full Code Here


      DeploymentUnit unit = assertDeploy(ear);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
      Class<?> businessInterface = getClass(BusinessInterface.class, unit);
     
      Deployment deployment =  initializeDeploymentBean();
      BeanDeploymentArchive bda = deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class, MySLSBean.class, BusinessInterface.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda, deployment.loadBeanDeploymentArchive(businessInterface));
   }
View Full Code Here

      DeploymentUnit unit = assertDeploy(ear);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
      Class<?> businessInterface = getClass(BusinessInterface.class, unit);
     
      Deployment deployment = initializeDeploymentBean();
      BeanDeploymentArchive bda = deployment.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(mySLSBeanClass));
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class, MySLSBean.class);
      // make sure double invocation does not affect the bda contents
      assertSame(bda, deployment.loadBeanDeploymentArchive(mySLSBeanClass));
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class, MySLSBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(businessInterface));
      assertSame(bda, deployment.loadBeanDeploymentArchive(mySLSBeanClass));
      assertBDAId(bda, EAR_NAME);
      assertExpectedClasses(bda, PlainJavaBean.class, MySLSBean.class, BusinessInterface.class);
   }
View Full Code Here

      JavaArchive ejbJar1 = createEjbJar("ejbJar1.jar", true, PlainJavaBean.class);
      ear1.addModule(ejbJar1);
      MockArchiveManifest.addManifest(ear1);
      DeploymentUnit unit = assertDeploy(ear1);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // simple2.ear
      EnterpriseArchive ear2 = ShrinkWrap.create(EnterpriseArchive.class, "simple2.ear");
      JavaArchive ejbJar2 = createEjbJar("ejbJar2.jar", true, MySLSBean.class, BusinessInterface.class);
      ear2.addModule(ejbJar2);
      MockArchiveManifest.addManifest(ear2);
      unit = assertDeploy(ear2);
      Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
      Class<?> businessInterface = getClass(BusinessInterface.class, unit);
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      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

      ear2.addModule(ejbJar2);
      MockArchiveManifest.addManifest(ear2);
      unit = assertDeploy(ear2);
      Class<?> mySLSBeanClass = getClass(MySLSBean.class, unit);
      Class<?> businessInterface = getClass(BusinessInterface.class, unit);
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      BeanDeploymentArchive bda2 = deployment2.getBeanDeploymentArchives().iterator().next();
      // contents of BDA2
      assertBDAId(bda2, "simple2.ear");
      assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
      // call loadBDA
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(mySLSBeanClass));
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(businessInterface));
      // make sure that loadBDA did not change the contents of BDA2
      assertBDAId(bda2, "simple2.ear");
      assertExpectedClasses(bda2, MySLSBean.class, BusinessInterface.class);
     
      // creation of bda1 on demand
      BeanDeploymentArchive bda1 = deployment2.loadBeanDeploymentArchive(plainJavaBeanClass);
      assertBDAId(bda1, "simple1.ear");
      assertExpectedClasses(bda1, PlainJavaBean.class);
      assertNoBeansXml(bda1);
      // double invocation
      assertSame(bda1, deployment2.loadBeanDeploymentArchive(plainJavaBeanClass));
      assertBDAId(bda1, "simple1.ear");
      assertExpectedClasses(bda1, PlainJavaBean.class);
      assertNoBeansXml(bda1);
   }
View Full Code Here

   public void testWars() throws Exception
   {
      WebArchive war1 = createWar("simple1.war", true, ServletWebBean.class);
      DeploymentUnit unit = assertDeploy(war1);
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);

      WebArchive war2 = createWar("simple2.war", true, NotWBJsfBean.class);
      unit = assertDeploy(war2);
      Class<?> notWBJsfBeanClass = getClass(NotWBJsfBean.class, unit);
      Deployment deployment2 = initializeDeploymentBean(unit);

      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
      //assertCannotLoadBDA(deployment1, notWBJsfBeanClass);
      //assertCannotLoadBDA(deployment2, servletWebBeanClass);
     
      BeanDeploymentArchive bda1 = deployment1.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda1, "simple1.war");
      assertExpectedClasses(bda1, ServletWebBean.class);
      assertSame(bda1, deployment1.loadBeanDeploymentArchive(servletWebBeanClass));
      // make sure loadBDA didn't change the bda structure
      assertBDAId(bda1, "simple1.war");
      assertExpectedClasses(bda1, ServletWebBean.class);
     
      BeanDeploymentArchive bda2 = deployment2.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda2, "simple2.war");
      assertExpectedClasses(bda2, NotWBJsfBean.class);
      assertSame(bda2, deployment2.loadBeanDeploymentArchive(notWBJsfBeanClass));
      // make sure loadBDA didn't change the bda structure
      assertBDAId(bda2, "simple2.war");
      assertExpectedClasses(bda2, NotWBJsfBean.class);
   }
View Full Code Here

   {
      WebArchive war = createWarWithLib(true, true);
      DeploymentUnit unit = assertDeploy(war);
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, unit);
      Deployment deployment = initializeDeploymentBean();
     
      BeanDeploymentArchive bda = deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(servletWebBeanClass));
      assertSame(bda, deployment.loadBeanDeploymentArchive(uiWebBeanClass));
      // make sure bda is unchanged
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
   }
View Full Code Here

   {
      WebArchive war = createWarWithLib(true, false);
      DeploymentUnit unit = assertDeploy(war);
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, unit);
      Deployment deployment = initializeDeploymentBean();
     
      BeanDeploymentArchive bda = deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(servletWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(uiWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      // duplicate call makes no difference in the bda contents
      assertSame(bda, deployment.loadBeanDeploymentArchive(uiWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
   }
View Full Code Here

   {
      WebArchive war = createWarWithLib(false, true);
      DeploymentUnit unit = assertDeploy(war);
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, unit);
      Deployment deployment = initializeDeploymentBean();
     
      BeanDeploymentArchive bda = deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(servletWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      // duplicate call makes no difference in the bda contents
      assertSame(bda, deployment.loadBeanDeploymentArchive(servletWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(uiWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
   }
View Full Code Here

      WebArchive war = createWarWithLibs(true, true, false);
      DeploymentUnit unit = assertDeploy(war);
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, unit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, unit);
      Class<?> crmWebBeanClass = getClass(CrmWebBean.class, unit);
      Deployment deployment = initializeDeploymentBean();
     
      BeanDeploymentArchive bda = deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(servletWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(uiWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class);
      assertSame(bda, deployment.loadBeanDeploymentArchive(crmWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class, CrmWebBean.class);
      // duplicate call makes no difference in the bda contents
      assertSame(bda, deployment.loadBeanDeploymentArchive(crmWebBeanClass));
      assertBDAId(bda, WAR_NAME);
      assertExpectedClasses(bda, ServletWebBean.class, UIWebBean.class, CrmWebBean.class);
   }
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.