Examples of ServletExternalContext


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

    @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

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

    }

    @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

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

    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

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

        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

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

        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

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

   
    public void testServiceFound() throws Exception {
        final MockRequestContext context = new MockRequestContext();
        final MockHttpServletRequest request = new MockHttpServletRequest();
        request.setParameter("service", "test");
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, new MockHttpServletResponse()));
       
        final Event event = this.action.execute(context);

        assertEquals("test", WebUtils.getService(context).getId());
        assertEquals("success", event.getId());
View Full Code Here

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

    public void testServiceTicketFromCookie() throws Exception {
        MockRequestContext context = new MockRequestContext();
        context.getFlowScope().put("service", TestUtils.getService());
        context.getFlowScope().put("ticketGrantingTicketId", this.ticketGrantingTicket);
        MockHttpServletRequest request = new MockHttpServletRequest();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        request.addParameter("service", "service");
        request.setCookies(new Cookie[] {new Cookie("TGT",
            this.ticketGrantingTicket)});
View Full Code Here

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

    @Test
    public void testTicketGrantingTicketFromRequest() throws Exception {
        MockRequestContext context = new MockRequestContext();
        context.getFlowScope().put("service", TestUtils.getService());
        MockHttpServletRequest request = new MockHttpServletRequest();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        request.addParameter("service", "service");
        WebUtils.putTicketGrantingTicketInRequestScope(context,
            this.ticketGrantingTicket);
View Full Code Here

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

    @Test
    public void testTicketGrantingTicketNoTgt() throws Exception {
        MockRequestContext context = new MockRequestContext();
        context.getFlowScope().put("service", TestUtils.getService());
        MockHttpServletRequest request = new MockHttpServletRequest();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        request.addParameter("service", "service");
        WebUtils.putTicketGrantingTicketInRequestScope(context, "bleh");

        assertEquals("error", this.action.execute(context).getId());
View Full Code Here

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

    @Test
    public void testTicketGrantingTicketNotTgtButGateway() throws Exception {
        MockRequestContext context = new MockRequestContext();
        context.getFlowScope().put("service", TestUtils.getService());
        MockHttpServletRequest request = new MockHttpServletRequest();
        context.setExternalContext(new ServletExternalContext(
            new MockServletContext(), request, new MockHttpServletResponse()));
        request.addParameter("service", "service");
        request.addParameter("gateway", "true");
        WebUtils.putTicketGrantingTicketInRequestScope(context, "bleh");
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.