Package org.springframework.webflow.context.servlet

Examples of org.springframework.webflow.context.servlet.ServletExternalContext


        request.addParameter("username", "test");
        request.addParameter("password", "test");
        request.addParameter("warn", "true");
        request.addParameter("service", "test");

        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, response));
        context.getRequestScope().put("credentials",
            TestUtils.getCredentialsWithSameUsernameAndPassword());
//       this.action.bind(context);
//       assertEquals("success", this.action.submit(context).getId());
View Full Code Here


        final MockRequestContext context = new MockRequestContext();

        request.addParameter("username", "test");
        request.addParameter("password", "test2");

        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));

        context.getRequestScope().put("credentials",
            TestUtils.getCredentialsWithDifferentUsernameAndPassword());
        context.getRequestScope().put(
View Full Code Here

        request.addParameter("renew", "true");
        request.addParameter("service", "test");
        request.addParameter("username", "test");
        request.addParameter("password", "test");
       
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        context.getFlowScope().put("service", TestUtils.getService("test"));
    //    this.action.bind(context);
     //   assertEquals("warn", this.action.submit(context).getId());
    }
View Full Code Here

        request.addParameter("renew", "true");
        request.addParameter("service", "test");
        request.addParameter("username", "test2");
        request.addParameter("password", "test2");

        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
    //    this.action.bind(context);

    //    assertEquals("success", this.action.submit(context).getId());
    }
View Full Code Here

        context.getFlowScope().put("ticketGrantingTicketId", ticketGrantingTicket);
        request.addParameter("renew", "true");
        request.addParameter("service", "test");

        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        context.getRequestScope().put("credentials",
            TestUtils.getCredentialsWithDifferentUsernameAndPassword());
        context.getRequestScope().put(
            "org.springframework.validation.BindException.credentials",
View Full Code Here

    @Test
    public void testTestBindingWithoutCredentialsBinder() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        final MockHttpServletRequest request = new MockHttpServletRequest();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
    //    context.setLastEvent(new Event(this, "test"));
        request.addParameter("username", "test");
        request.addParameter("password", "test");
View Full Code Here

    }

    @Test
    public void testTestBindingWithCredentialsBinder() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), new MockHttpServletRequest(),
            new MockHttpServletResponse()));
  //      context.setLastEvent(new Event(this, "test"));

        final CredentialsBinder cb = new CredentialsBinder(){
View Full Code Here

    public void testSettingContextPath() throws Exception {
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final String CONST_CONTEXT_PATH = "/test";
        request.setContextPath(CONST_CONTEXT_PATH);
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));
       
        this.action.doExecute(context);
       
        assertEquals(CONST_CONTEXT_PATH, this.warnCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH, this.tgtCookieGenerator.getCookiePath());
View Full Code Here

        final MockHttpServletRequest request = new MockHttpServletRequest();
        final String CONST_CONTEXT_PATH = "/test";
        final String CONST_CONTEXT_PATH_2 = "/test1";
        request.setContextPath(CONST_CONTEXT_PATH);
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));
       
        this.action.doExecute(context);
       
        assertEquals(CONST_CONTEXT_PATH, this.warnCookieGenerator.getCookiePath());
        assertEquals(CONST_CONTEXT_PATH, this.tgtCookieGenerator.getCookiePath());
View Full Code Here

        assertEquals(CONST_CONTEXT_PATH, this.tgtCookieGenerator.getCookiePath());
    }
   
    public void testNoServiceFound() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), new MockHttpServletRequest(), new MockHttpServletResponse()));
       
        final Event event = this.action.execute(context);

        assertNull(WebUtils.getService(context));
       
View Full Code Here

TOP

Related Classes of org.springframework.webflow.context.servlet.ServletExternalContext

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.