Examples of MockHttpSession


Examples of org.apache.struts.mock.MockHttpSession

        // -- configure the ServletConfig
        this.servletConfig = new MockServletConfig();
        this.servletConfig.setServletContext(servletContext);

        // -- configure the request
        this.request = new MockHttpServletRequest(new MockHttpSession());

        pageContext =
            new MockPageContext(servletConfig, request,
                new MockHttpServletResponse());
    }
View Full Code Here

Examples of org.apache.webbeans.cditest.owb.MockHttpSession

    private MockHttpServletRequest request;

    public void bootContainer() throws Exception
    {
        this.servletContext = new MockServletContext();
        this.session = new MockHttpSession();
        this.request = new MockHttpServletRequest(this.session);
        this.lifecycle = new HybridStandaloneLifeCycle(this.servletContext, this.session, this.request);
        this.lifecycle.startApplication(this.servletContext);
    }
View Full Code Here

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

    }

    @Test
    public void testTransactionalInterceptor()
    {
        ContextFactory.initSessionContext(new MockHttpSession());
       
        // Interceptors must explicitly get enabled via XML. We fake this:
        InterceptorsManager.getInstance().addNewInterceptor(TransactionalInterceptor.class);
       
        defineInterceptor(TransactionalInterceptor.class);
       
        Bean<ShoppingCard> bean = defineManagedBean(ShoppingCard.class);
        ShoppingCard card = getManager().getInstance(bean);
       
        card.placeOrder();
       
        Assert.assertTrue(ShoppingCard.getCALLED());
       
        card.placeOrder2();
       
        Assert.assertFalse(ShoppingCard.getCALLED());
               
        ContextFactory.destroySessionContext(new MockHttpSession());
    }
View Full Code Here

Examples of org.apache.webbeans.test.mock.MockHttpSession

    public Manager getManager()
    {

        ContextFactory.initApplicationContext(null);
        ContextFactory.initRequestContext(null);
        ContextFactory.initSessionContext(new MockHttpSession());
        ContextFactory.initConversationContext(null);

        return ActivityManager.getInstance().getRootActivity();
    }
View Full Code Here

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

Examples of org.apache.webbeans.web.tests.MockHttpSession

     */
    @Test
    public void sessionIsIdle()
    {
        // ----- setup
        HttpSession session = new MockHttpSession();

        DefaultOwbFailOverService failoverService =
                (DefaultOwbFailOverService) getWebBeansContext().getService(FailOverService.class);

        failoverService.enableFailOverSupport(true);
        failoverService.enablePassivationSupport(true);



        // ----- execute
        failoverService.sessionIsIdle(session);



        // ----- assert
        FailOverSessionActivationListener listener = (FailOverSessionActivationListener)
                session.getAttribute(FailOverSessionActivationListener.SESSION_ATTRIBUTE_NAME);
        FailOverBag failOverBag = (FailOverBag)
                session.getAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME);

        Assert.assertNotNull(listener);
        Assert.assertNotNull(failOverBag);
        Assert.assertFalse(failOverBag.isSessionInUse());
        Assert.assertFalse(failoverService.isPassivation());
View Full Code Here

Examples of org.apache.wicket.protocol.http.MockHttpSession

          prevApplication = Application.get();
        }
        Application.set(webApplication);

        ServletContext context = webApplication.getServletContext();
        MockHttpSession httpSession = new MockHttpSession(context);

        MockServletRequest servletRequest = new MockServletRequest(webApplication, httpSession, context);
        callback.configure(new MockRequest(servletRequest));
        servletRequest.setDefaultHeaders();
View Full Code Here

Examples of org.apache.wicket.protocol.http.mock.MockHttpSession

      }
    };

    application.setWicketFilter(filter);

    httpSession = new MockHttpSession(servletContext);

    ThreadContext.detach();

    this.application = application;
View Full Code Here

Examples of org.apache.wicket.protocol.http.mock.MockHttpSession

      }
    };

    application.setWicketFilter(filter);

    httpSession = new MockHttpSession(servletContext);

    ThreadContext.detach();

    this.application = application;
View Full Code Here

Examples of org.apache.wicket.protocol.http.mock.MockHttpSession

      }
    };

    application.setWicketFilter(filter);

    httpSession = new MockHttpSession(servletContext);

    ThreadContext.detach();

    this.application = application;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.