Package org.jboss.weld.mock

Examples of org.jboss.weld.mock.AbstractDeployment


        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

        // 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

        // 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

            public Collection<EjbDescriptor<?>> getEjbs() {
                return ImmutableSet.<EjbDescriptor<?>>of(fooDescriptor, barDescriptor, bazDescriptor);
            }
        };

        final Deployment deployment = new AbstractDeployment(bda) {
            @Override
            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return bda;
            }
            @Override
View Full Code Here

                getServices().add(InjectionServices.class, new TestInjectionServices());
            }
        };

        // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
        Deployment deployment = new AbstractDeployment(new BeanDeploymentArchive[] { bda }) {

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

TOP

Related Classes of org.jboss.weld.mock.AbstractDeployment

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.