Package org.springframework.webflow.test

Examples of org.springframework.webflow.test.MockFlowExecutionKey


    context.getFlashScope().put("boop", "bing");
    context.getMockExternalContext().setCurrentUser("Keith");
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new ServletMvcView(mvcView, context);
    view.render();
    assertTrue(renderCalled);
    assertEquals("bar", model.get("foo"));
View Full Code Here


    request.setPathInfo("/foo");
    request.setRequestURI("/springtravel/app/foo");
    request.setMethod("GET");
    request.addParameter("execution", "12345");
    executor.resumeExecution("12345", context);
    FlowException flowException = new NoSuchFlowExecutionException(new MockFlowExecutionKey("12345"), null);
    EasyMock.expectLastCall().andThrow(flowException);
    EasyMock.replay(new Object[] { executor });
    ModelAndView mv = controller.handleRequest(request, response);
    assertNull(mv);
    assertEquals("/springtravel/app/foo", response.getRedirectedUrl());
View Full Code Here

    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory();
    factory.setExecutionKeyFactory(keyFactory);
    FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1");
    LocalAttributeMap conversationScope = new LocalAttributeMap();
    SimpleFlowDefinitionLocator locator = new SimpleFlowDefinitionLocator();
    FlowSessionImpl session1 = new FlowSessionImpl();
    session1.setFlowId("flow");
    session1.setStateId("end");
View Full Code Here

    RenderResponse response = new MockRenderResponse();
    MockRequestContext context = new MockRequestContext();
    context.getMockExternalContext().setNativeContext(new MockPortletContext());
    context.getMockExternalContext().setNativeRequest(request);
    context.getMockExternalContext().setNativeResponse(response);
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = (org.springframework.web.servlet.View) EasyMock
        .createMock(org.springframework.web.servlet.View.class);
    AbstractMvcView view = new PortletMvcView(mvcView, context);
    view.render();
    assertNotNull(request.getAttribute(ViewRendererServlet.VIEW_ATTRIBUTE));
View Full Code Here

    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = (org.springframework.web.servlet.View) EasyMock
        .createMock(org.springframework.web.servlet.View.class);
    AbstractMvcView view = new PortletMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    view.processUserEvent();
View Full Code Here

    request.setPathInfo("/foo");
    request.setRequestURI("/springtravel/app/foo");
    request.setMethod("GET");
    request.addParameter("execution", "12345");
    flowExecutor.resumeExecution("12345", context);
    FlowException flowException = new NoSuchFlowExecutionException(new MockFlowExecutionKey("12345"), null);
    EasyMock.expectLastCall().andThrow(flowException);
    EasyMock.replay(new Object[] { flowExecutor });
    flowHandlerAdapter.handle(request, response, flowHandler);
    assertEquals("/springtravel/app/foo", response.getRedirectedUrl());
    EasyMock.verify(new Object[] { flowExecutor });
View Full Code Here

    context.getFlashScope().put("boop", "bing");
    context.getMockExternalContext().setCurrentUser("Keith");
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    view.render();
    assertTrue(renderCalled);
View Full Code Here

    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    view.setConversionService(new DefaultConversionService());
    view.render();
View Full Code Here

  public void testResumeNoEvent() throws Exception {
    MockRequestContext context = new MockRequestContext();
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.processUserEvent();
    assertFalse(view.hasFlowEvent());
    assertNull(view.getFlowEvent());
View Full Code Here

    MockRequestContext context = new MockRequestContext();
    context.putRequestParameter("_eventId", "submit");
    context.getMockExternalContext().setNativeContext(new MockServletContext());
    context.getMockExternalContext().setNativeRequest(new MockHttpServletRequest());
    context.getMockExternalContext().setNativeResponse(new MockHttpServletResponse());
    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
View Full Code Here

TOP

Related Classes of org.springframework.webflow.test.MockFlowExecutionKey

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.