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

Examples of org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockHttpSession


    @Test
    public void testDecoratorEnabledInWarButPackagedInEjbJar() {

        // Create the BDA in which we will deploy Foo. This is equivalent to a ejb
        // jar
        final BeanDeploymentArchiveImpl ejbJar = new BeanDeploymentArchiveImpl("ejb-jar", Blah.class, BlahDecorator.class, BlahImpl.class);

        // Create the BDA in which we will deploy Bar. This is equivalent to a war
        BeansXml beansXml = new BeansXmlImpl(null, null, asList(BlahDecorator.class.getName()), null);
        final BeanDeploymentArchiveImpl war = new BeanDeploymentArchiveImpl("war", beansXml, BlahImpl2.class);

        // 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) {
View Full Code Here


    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

TOP

Related Classes of org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockHttpSession

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.