Package org.apache.webbeans.web.lifecycle.test

Examples of org.apache.webbeans.web.lifecycle.test.MockHttpSession


    }

    private void startCdiContexts(final String name) {
        final WebBeansContext wbc = this.container.getAppContexts(name).getWebBeansContext();
        if (wbc.getBeanManagerImpl().isInUse()) {
            final MockHttpSession session = new MockHttpSession();
            wbc.getContextsService().startContext(RequestScoped.class, null);
            wbc.getContextsService().startContext(SessionScoped.class, session);
            wbc.getContextsService().startContext(ConversationScoped.class, null);

            SESSIONS.put(name, session);
View Full Code Here


        options = new Options(properties);

        startNetworkServices();

        servletContext = new MockServletContext();
        session = new MockHttpSession();
        try {
            startContexts(webBeanContext.getContextsService(), servletContext, session);
        } catch (final Exception e) {
            logger().warning("can't start all CDI contexts", e);
        }
View Full Code Here

                throw new OpenEJBRuntimeException(e);
            }
        }

        servletContext = new MockServletContext();
        session = new MockHttpSession();

        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        final Context jndiContext = containerSystem.getJNDIContext();

        for (final EnvEntry entry : testBean.getEnvEntry()) { // set it in global jndi context since that's "app" entries and otherwise when we are no more in test bean context lookup fails
View Full Code Here

        options = new Options(properties);

        startNetworkServices();

        servletContext = new MockServletContext();
        session = new MockHttpSession();
        try {
            startContexts(webBeanContext.getContextsService(), servletContext, session);
        } catch (final Exception e) {
            logger().warning("can't start all CDI contexts", e);
        }
View Full Code Here

                throw new OpenEJBRuntimeException(e);
            }
        }

        servletContext = new MockServletContext();
        session = new MockHttpSession();

        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        final Context jndiContext = containerSystem.getJNDIContext();

        for (final EnvEntry entry : testBean.getEnvEntry()) { // set it in global jndi context since that's "app" entries and otherwise when we are no more in test bean context lookup fails
View Full Code Here

            final AppModule module = OpenEJBArchiveProcessor.createModule(archive, testClass);
            final AppInfo appInfo = configurationFactory.configureApplication(module);
            final AppContext appCtx = assembler.createApplication(appInfo, module.getClassLoader());

            final ServletContext appServletContext = new MockServletContext();
            final HttpSession appSession = new MockHttpSession();

            startContexts(appCtx.getWebBeansContext().getContextsService(), appServletContext, appSession);

            return new DeploymentInfo(appServletContext, appSession, appInfo, appCtx);
        } catch (final Exception e) {
View Full Code Here

                throw new OpenEJBRuntimeException(e);
            }
        }

        servletContext = new MockServletContext();
        session = new MockHttpSession();

        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        final Context jndiContext = containerSystem.getJNDIContext();

        for (final EnvEntry entry : testBean.getEnvEntry()) { // set it in global jndi context since that's "app" entries and otherwise when we are no more in test bean context lookup fails
View Full Code Here

            final AppModule module = OpenEJBArchiveProcessor.createModule(archive, testClass);
            final AppInfo appInfo = configurationFactory.configureApplication(module);
            final AppContext appCtx = assembler.createApplication(appInfo, module.getClassLoader());

            final ServletContext appServletContext = new MockServletContext();
            final HttpSession appSession = new MockHttpSession();

            startContexts(appCtx.getWebBeansContext().getContextsService(), appServletContext, appSession);

            return new DeploymentInfo(appServletContext, appSession, appInfo, appCtx);
        } catch (final Exception e) {
View Full Code Here

    }

    private void startCdiContexts(final String name) {
        final WebBeansContext wbc = this.container.getAppContexts(name).getWebBeansContext();
        if (wbc.getBeanManagerImpl().isInUse()) {
            final MockHttpSession session = new MockHttpSession();
            wbc.getContextsService().startContext(RequestScoped.class, null);
            wbc.getContextsService().startContext(SessionScoped.class, session);
            wbc.getContextsService().startContext(ConversationScoped.class, null);

            SESSIONS.put(name, session);
View Full Code Here

                throw new OpenEJBRuntimeException(e);
            }
        }

        servletContext = new MockServletContext();
        session = new MockHttpSession();

        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
        final Context jndiContext = containerSystem.getJNDIContext();

        for (final EnvEntry entry : testBean.getEnvEntry()) { // set it in global jndi context since that's "app" entries and otherwise when we are no more in test bean context lookup fails
View Full Code Here

TOP

Related Classes of org.apache.webbeans.web.lifecycle.test.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.