Package org.jboss.weld.bootstrap.spi

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


   }
  
   @Before
   public void setup() throws Exception
   {
      Deployment deployment = createDeployment(Service.class, Cat.class, CatService.class, Dog.class, DogService.class);
      bootstrap = new WeldBootstrap();
      bootstrap.startContainer(Environments.SE, deployment)
                  .startInitialization()
                  .deployBeans()
                  .validateBeans()
                  .endInitialization();

      manager = bootstrap.getManager(deployment.getBeanDeploymentArchives().iterator().next());

      bind(TestScoped.class,  BeanManager.class, manager);
     
      enricher = new CDIInjectionEnricher();
      injector.get().inject(enricher);
View Full Code Here


               beanClasses.add(c.getName());
            }
            return beanClasses;
         }
      };
      final Deployment deployment = new Deployment()
      {
         public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
         {
            return Arrays.asList((BeanDeploymentArchive)beanArchive);
         }
View Full Code Here

                            }
                        }
                        return url;
                    }
                };
                Deployment deployment = super.createDeployment(filterLoader, bootstrap);
                if (getTestKit() != null) {
                    Set<TestMixIn> optionalDependencies = getTestKit().getOptionalDependencies(CDIMixIn.this);
                    for (TestMixIn dependency : optionalDependencies) {
                        if (dependency instanceof CDIMixInParticipant) {
                           try {
View Full Code Here

        final BeanDeploymentArchive bda2 = new BeanDeploymentArchiveImpl("2", SimpleBean.class, FooTarget.class);

        final FooExtension extension = new FooExtension();

        // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
        Deployment deployment = new AbstractDeployment(ImmutableSet.of(bda1, bda2), transform(extension)) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                // Return bda2 if it is Observer2. Stick anything else which this test isn't about in bda1
                if (beanClass.equals(FooExtension.class)) {
                    return bda1;
View Full Code Here

        // Create the BDA to return from loadBeanDeploymentArchive for Observer2, this is probably a library, though could be another war or ejb jar
        // bda2 is accessible from bda1, but isn't added to it's accessibility graph by default. This similar to an archive which doesn't contain a beans.xml but does contain an extension
        final BeanDeploymentArchive bda2 = new BeanDeploymentArchiveImpl("2", Observer2.class);

        // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
        Deployment deployment = new AbstractDeployment(bda1, new Observer1(), new Observer2(), new CountingObserver1(), new CountingObserver2()) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                // Return bda2 if it is Observer2. Stick anything else which this test isn't about in bda1
                if (beanClass.equals(Observer2.class)) {
                    // If Observer2 is requested, then we need to add bda2 to the accessibility graph of bda1
View Full Code Here

        // Create the BDA to return from loadBeanDeploymentArchive for Observer2, this is probably a library, though could be another war or ejb jar
        // bda2 is accessible from bda1, but isn't added to it's accessibility graph by default. This similar to an archive which doesn't contain a beans.xml but does contain an extension
        final BeanDeploymentArchive bda2 = new BeanDeploymentArchiveImpl("2", CountingObserver2.class);

        // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
        Deployment deployment = new AbstractDeployment(bda1, new Observer1(), new Observer2(), new CountingObserver1(), new CountingObserver2()) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                // Return bda2 if it is Observer2. Stick anything else which this test isn't about in bda1
                if (beanClass.equals(CountingObserver2.class) || beanClass.equals(Bar.class)) {
                    // If Observer2 is requested, then we need to add bda2 to the accessibility graph of bda1
View Full Code Here

        BeanDeploymentArchiveImpl jar2 = new BeanDeploymentArchiveImpl("second-jar", Alt2.class);
        BeanDeploymentArchiveImpl war = new BeanDeploymentArchiveImpl("war");
        war.getBeanDeploymentArchives().add(jar1);
        war.getBeanDeploymentArchives().add(jar2);

        Deployment deployment = new FlatDeployment(war);

        TestContainer container = null;
        try {
            container = new TestContainer(deployment).startContainer().ensureRequestActive();
            BeanManagerImpl warBeanManager = (BeanManagerImpl) container.getBeanManager(war);
View Full Code Here

        BeanDeploymentArchiveImpl jar2 = new BeanDeploymentArchiveImpl("second-jar", new BeansXmlImpl(Arrays.asList(Alt2.class.getName()), Collections.<String>emptyList(), null, null), Alt2.class);
        BeanDeploymentArchiveImpl war = new BeanDeploymentArchiveImpl("war");
        war.getBeanDeploymentArchives().add(jar1);
        war.getBeanDeploymentArchives().add(jar2);

        Deployment deployment = new FlatDeployment(war);

        TestContainer container = null;
        try {
            container = new TestContainer(deployment).startContainer().ensureRequestActive();
            BeanManagerImpl warBeanManager = (BeanManagerImpl) container.getBeanManager(war);
View Full Code Here

        // The war can access the ejb jar
        war.getBeanDeploymentArchives().add(ejbJar);

        // Create a deployment, any other classes are put into the ejb-jar (not
        // relevant to test)
        Deployment deployment = new AbstractDeployment(war, ejbJar) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return ejbJar;
            }
View Full Code Here

        // The war can access the ejb jar
        war.getBeanDeploymentArchives().add(ejbJar);

        // Create a deployment, any other classes are put into the ejb-jar (not
        // relevant to test)
        Deployment deployment = new AbstractDeployment(ejbJar, war) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return ejbJar;
            }
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.