Examples of MockHttpSession


Examples of org.springframework.mock.web.MockHttpSession

  public void setUp() throws Exception {
    service = new StandardSerializingAuditFilterService();
    child = new MockEventfulBaseService();
    service.setChildService(child);
   
    httpSession = new MockHttpSession();
   
    Map map = new HashMap();
    map.put(HttpSession.class, httpSession);
   
    MockLifeCycle.begin(service, new StandardEnvironment(null, map));
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

  @Before
  public void createMainGenerator() {
    fr = new Locale("fr", "FR");
    en = new Locale("en", "US");
   
    session = new MockHttpSession();
    Config.set(session, Config.FMT_LOCALE, fr);
   
    request = new MockHttpServletRequest();
    request.setSession(session);
    Config.set(request, Config.FMT_LOCALE, en);
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

    this.interceptor = getInterceptor();
  }

  public void testPreHandleWithSessionStorageEnabled() throws Exception {
    // setup mock session
    MockHttpSession session = new MockHttpSession();
    session.setAttribute(AbstractWorkflowContextHandlerInterceptor.SESSION_KEY_INSTANCE_ID, MOCK_INSTANCE_ID);
    this.request.setSession(session);

    this.interceptor.preHandle(this.request, new MockHttpServletResponse(), null);

    assertEquals("Caller not set", MOCK_CALLER, this.context.getCaller());
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

  }

  public void testPostHandleWithSessionStorageEnabled() throws Exception {
    this.context.setInstanceId(MOCK_INSTANCE_ID.longValue());

    MockHttpSession session = new MockHttpSession();
    this.request.setSession(session);

    this.interceptor.postHandle(this.request, new MockHttpServletResponse(), null, null);

    assertEquals(session.getAttribute(AbstractWorkflowContextHandlerInterceptor.SESSION_KEY_INSTANCE_ID), MOCK_INSTANCE_ID);
  }
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

  }

  public void testPostHandleWithSessionStorageDisabled() throws Exception {
    this.context.setInstanceId(MOCK_INSTANCE_ID.longValue());

    MockHttpSession session = new MockHttpSession();
    this.request.setSession(session);

    this.interceptor.setSessionStorageEnabled(false);
    this.interceptor.postHandle(this.request, new MockHttpServletResponse(), null, null);

    assertNull(session.getAttribute(AbstractWorkflowContextHandlerInterceptor.SESSION_KEY_INSTANCE_ID));
  }
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

    private List<SSOSiteCredentials> ssoSiteCredsOfSubject;
   
    @Override
    public void setUp()
    {
        session = new MockHttpSession();
       
        ssoSiteCredsOfSubject = new ArrayList<SSOSiteCredentials>();
       
        DefaultSSOSiteCredentials siteCreds = new DefaultSSOSiteCredentials("http://www.localhost.com", "www.localhost.com");
        siteCreds.setUsername("admin");
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

        springContext.setServletContext(servletContext);
        springContext.refresh();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
       
        MockHttpServletRequest httpRequest = new MockHttpServletRequest(servletContext, "POST", "/ajax/submit.action");
        MockHttpSession session = new MockHttpSession(servletContext);
        httpRequest.setSession(session);
        httpRequest.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
        httpRequest.setParameter(ajaxInterceptor.getAjaxParameter(), ajaxInterceptor.AJAX_SUBMIT_REQUEST);       
        httpRequest.setParameter(ajaxInterceptor.getEventParameter(), "submit");
       
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

        springContext.setServletContext(servletContext);
        springContext.refresh();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
       
        MockHttpServletRequest httpRequest = new MockHttpServletRequest(servletContext, "POST", "/ajax/submit.action");
        MockHttpSession session = new MockHttpSession(servletContext);
        httpRequest.setSession(session);
        httpRequest.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
        httpRequest.setParameter(ajaxInterceptor.getAjaxParameter(), ajaxInterceptor.AJAX_SUBMIT_REQUEST);       
        httpRequest.setParameter(ajaxInterceptor.getEventParameter(), "validate");
       
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

        springContext.setServletContext(servletContext);
        springContext.refresh();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
       
        MockHttpServletRequest httpRequest = new MockHttpServletRequest(servletContext, "POST", "/ajax/submit.action");
        MockHttpSession session = new MockHttpSession(servletContext);
        httpRequest.setSession(session);
        httpRequest.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
        httpRequest.setParameter(ajaxInterceptor.getAjaxParameter(), ajaxInterceptor.AJAX_SUBMIT_REQUEST);       
        httpRequest.setParameter(ajaxInterceptor.getEventParameter(), "validate");
       
View Full Code Here

Examples of org.springframework.mock.web.MockHttpSession

        springContext.setServletContext(servletContext);
        springContext.refresh();
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
       
        MockHttpServletRequest httpRequest = new MockHttpServletRequest(servletContext, "POST", "/ajax/submit.action");
        MockHttpSession session = new MockHttpSession(servletContext);
        httpRequest.setSession(session);
        httpRequest.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);
        httpRequest.setParameter(ajaxInterceptor.getAjaxParameter(), ajaxInterceptor.AJAX_SUBMIT_REQUEST);
        httpRequest.setParameter(ajaxInterceptor.getEventParameter(), "fail");
       
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.