Package org.jboss.arquillian.container.weld.ee.embedded_1_1

Examples of org.jboss.arquillian.container.weld.ee.embedded_1_1.Version


    public void prepareContainer() {
        final EjbDescriptor<Foo> fooDescriptor = new EjbDescriptorImpl<Foo>(Foo.class, Foo.class, EnhancedFoo.class, SessionBeanType.STATEFUL);
        final EjbDescriptor<Bar> barDescriptor = new EjbDescriptorImpl<Bar>(Bar.class, BarLocal.class, EnhancedBar.class, SessionBeanType.STATEFUL);
        final EjbDescriptor<Baz> bazDescriptor = new EjbDescriptorImpl<Baz>(Baz.class, Baz.class, EnhancedBaz.class, null);

        final BeanDeploymentArchive bda = new BeanDeploymentArchiveImpl("1",
                Foo.class,
                Bar.class,
                BarLocal.class,
                BarDecorator.class,
                BarInterceptor.class,
View Full Code Here


    protected TestContainer bootstrapContainer(int id, Collection<Class<?>> classes) {
        // Bootstrap container
        SwitchableSingletonProvider.use(id);

        TestContainer container = new TestContainer(new FlatDeployment(new BeanDeploymentArchiveImpl(classes)));
        container.getDeployment().getServices().add(ProxyServices.class, new SwitchableCLProxyServices());
        container.startContainer();
        container.ensureRequestActive();

        return container;
View Full Code Here

    @Test
    public void testStaticResourceInjectionWithInjectionServices() {

        // Create the BDA in which we will deploy FooExtension. This BDA does not have access to bda2
        final BeanDeploymentArchive bda = new BeanDeploymentArchiveImpl("1", InjectedClass.class) {
            @Override
            protected void configureServices() {
                getServices().add(InjectionServices.class, new TestInjectionServices());
            }
        };
View Full Code Here

public class EmptyBeanDeploymentArchive implements BeanDeploymentArchive {

    private final ServiceRegistry services = new SimpleServiceRegistry();

    public EmptyBeanDeploymentArchive() {
        this.services.add(EjbInjectionServices.class, new MockEjbInjectionServices());
        this.services.add(JpaInjectionServices.class, new MockJpaInjectionServices());
        this.services.add(ResourceInjectionServices.class, new MockResourceInjectionServices());
    }
View Full Code Here

               HttpSessionManager sessionManager = Utils.getBeanReference(manager, HttpSessionManager.class);

               HttpSession session = sessionStore.get(id.getId());
               if(session == null)
               {
                  session = new MockHttpSession(id.getId(), new MockServletContext("/"));
               }
               sessionManager.setSession(session);
               sessionStore.put(id.getId(), session);
            }
         }
View Full Code Here

    private final ServiceRegistry services = new SimpleServiceRegistry();

    public EmptyBeanDeploymentArchive() {
        this.services.add(EjbInjectionServices.class, new MockEjbInjectionServices());
        this.services.add(JpaInjectionServices.class, new MockJpaInjectionServices());
        this.services.add(ResourceInjectionServices.class, new MockResourceInjectionServices());
    }
View Full Code Here

    private final ServiceRegistry services = new SimpleServiceRegistry();

    public EmptyBeanDeploymentArchive() {
        this.services.add(EjbInjectionServices.class, new MockEjbInjectionServices());
        this.services.add(JpaInjectionServices.class, new MockJpaInjectionServices());
        this.services.add(ResourceInjectionServices.class, new MockResourceInjectionServices());
    }
View Full Code Here

               HttpSessionManager sessionManager = Utils.getBeanReference(manager, HttpSessionManager.class);

               HttpSession session = sessionStore.get(id.getId());
               if(session == null)
               {
                  session = new MockHttpSession(id.getId(), new MockServletContext("/"));
               }
               sessionManager.setSession(session);
               sessionStore.put(id.getId(), session);
            }
         }
View Full Code Here

     * @return
     */
    public static Test suite() {
        // Create and start the TestContainer, which takes care of starting the container, deploying the
        // classes, starting the contexts etc.
        TestContainer container = new TestContainer(

                // The classes to deploy as beans
                Convertible.class,
                Seat.class,
                V8Engine.class,
                Cupholder.class,
                FuelTank.class,
                Tire.class,
                // Producer Methods allowing to expose DriversSeat, SpareTire, @Named("spare") SpareTire, @Drivers Seat
                Producers.class
        );
        container.startContainer();

        // Our entry point is the single bean deployment archive
        BeanManager beanManager = container.getBeanManager(container.getDeployment().getBeanDeploymentArchives().iterator().next());

        // Obtain a reference to the Car and pass it to the TCK to generate the testsuite
        Bean<?> bean = beanManager.resolve(beanManager.getBeans(Car.class));
        Car instance = (Car) beanManager.getReference(bean, Car.class, beanManager.createCreationalContext(bean));

View Full Code Here

public class InjectionServicesTest {

    @Test
    public void testInjectionOfTarget() {
        TestContainer container = new TestContainer(Foo.class, Bar.class);
        CheckableInjectionServices ijs = new CheckableInjectionServices();
        for (BeanDeploymentArchive bda : container.getDeployment().getBeanDeploymentArchives()) {
            bda.getServices().add(InjectionServices.class, ijs);
        }
        container.startContainer();
        container.ensureRequestActive();

        BeanManager manager = getBeanManager(container);

        Bean<? extends Object> bean = manager.resolve(manager.getBeans(Foo.class));
        ijs.reset();
        Foo foo = (Foo) manager.getReference(bean, Foo.class, manager.createCreationalContext(bean));

        Assert.assertTrue(ijs.isBefore());
        Assert.assertTrue(ijs.isAfter());
        Assert.assertTrue(ijs.isInjectedAfter());
        Assert.assertTrue(ijs.isInjectionTargetCorrect());
        Assert.assertEquals(ijs.getAroundInjectForFooCalled(), 1);
        Assert.assertEquals(ijs.getAroundInjectForBarCalled(), 1);

        Assert.assertNotNull(foo.getBar());
        Assert.assertEquals("hi!", foo.getMessage());


        container.stopContainer();
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.container.weld.ee.embedded_1_1.Version

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.