Package org.springframework.webflow.test

Examples of org.springframework.webflow.test.MockFlowExecutionKey


  public void testDefaultHandleNoSuchFlowExecutionException() throws Exception {
    setupRequest("/springtravel", "/app", "/foo", "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.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(createExpressionParser());
    view.setMessageCodesResolver(new WebFlowMessageCodesResolver());
    view.processUserEvent();
View Full Code Here

  public void testDefaultHandleNoSuchFlowExecutionExceptionAjaxRequest() throws Exception {
    setupRequest("/springtravel", "/app", "/foo", "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 });
    context.setAjaxRequest(true);
    request.addHeader("Accept", "text/html;type=ajax");
    flowHandlerAdapter.handle(request, response, flowHandler);
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(createExpressionParser());
    view.setMessageCodesResolver(new WebFlowMessageCodesResolver());
    view.processUserEvent();
View Full Code Here

    context.getCurrentState().getAttributes().put("model", modelExpression);
    context.getFlowScope().put("testModel", testModel);
    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.setValidator(validator);
    view.setExpressionParser(createExpressionParser());
View Full Code Here

    context.getCurrentState().getAttributes().put("model", modelExpression);
    context.getFlowScope().put("testModel", testModel);
    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.setValidator(validator);
    view.setExpressionParser(createExpressionParser());
View Full Code Here

  public void testname() throws Exception {

  }

  public void testWriteFlowSerializedView() throws Exception {
    EasyMock.expect(this.flowExecutionContext.getKey()).andReturn(new MockFlowExecutionKey("e1s1"));
    LocalAttributeMap<Object> viewMap = new LocalAttributeMap<Object>();
    EasyMock.expect(this.requestContext.getViewScope()).andStubReturn(viewMap);
    EasyMock.expect(this.requestContext.getFlowExecutionContext()).andReturn(this.flowExecutionContext);
    EasyMock.replay(this.requestContext, this.flowExecutionContext);
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

    this.requestContext = new MockRequestContext();
    MockFlowExecutionContext executionContext = requestContext.getMockFlowExecutionContext();
    MockFlowSession session = executionContext.getMockActiveSession();
    ViewFactory viewFactory = EasyMock.createNiceMock(ViewFactory.class);
    session.setState(new ViewState(session.getDefinitionInternal(), "view", viewFactory));
    executionContext.setKey(new MockFlowExecutionKey("x"));
    RequestContextHolder.setRequestContext(requestContext);
  }
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.