Package org.springframework.webflow.test

Examples of org.springframework.webflow.test.MockExternalContext


      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw e;
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    execution.start(null, context);
    assertTrue(exceptionHandler.getHandled());
  }
View Full Code Here


      }
    };
    StubFlowExecutionExceptionHandler exceptionHandler = new StubFlowExecutionExceptionHandler();
    s.getExceptionHandlerSet().add(exceptionHandler);
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    execution.start(null, context);
    assertTrue(exceptionHandler.getHandled());
  }
View Full Code Here

      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw new FlowExecutionException("flow", "state", "Oops");
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    execution.start(null, context);
    assertEquals(2, exceptionHandler.getHandleCount());
  }
View Full Code Here

  public void testStartCannotCallTwice() {
    Flow flow = new Flow("flow");
    new EndState(flow, "end");
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    try {
      execution.start(null, context);
      fail("Should've failed");
    } catch (IllegalStateException e) {
View Full Code Here

    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    execution.resume(context);
    assertEquals(1, mockListener.getResumingCount());
    assertEquals(2, mockListener.getPausedCount());
  }
View Full Code Here

    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    try {
      execution.resume(context);
      assertEquals(1, mockListener.getResumingCount());
      fail("Should have failed");
    } catch (FlowExecutionException e) {
View Full Code Here

  public void testResumeAfterEnding() {
    Flow flow = new Flow("flow");
    new EndState(flow, "end");
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    try {
      execution.resume(context);
      fail("Should've failed");
    } catch (IllegalStateException e) {
View Full Code Here

    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    try {
      execution.resume(context);
    } catch (FlowExecutionException e) {
      assertEquals(flow.getId(), e.getFlowId());
      assertEquals(state.getId(), e.getStateId());
View Full Code Here

    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    context = new MockExternalContext();
    try {
      execution.resume(context);
    } catch (FlowExecutionException e) {
      assertEquals(flow.getId(), e.getFlowId());
      assertEquals(state.getId(), e.getStateId());
View Full Code Here

    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    assertEquals(0, mockListener.getTransitionExecutingCount());
    execution.resume(context);
    assertTrue(execution.hasEnded());
    assertEquals(1, mockListener.getTransitionExecutingCount());
View Full Code Here

TOP

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

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.