Package org.springframework.webflow.test

Examples of org.springframework.webflow.test.MockExternalContext


      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }
View Full Code Here


      }
    };
    flowDefinition.setStartState(state);
    factory.setExecutionKeyFactory(new MockFlowExecutionKeyFactory());
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    execution.start(null, new MockExternalContext());
    assertTrue(getKeyCalled);
    assertTrue(removeAllSnapshotsCalled);
    assertTrue(removeSnapshotCalled);
    assertTrue(updateSnapshotCalled);
    assertNull(execution.getKey());
View Full Code Here

    new EndState(flow, "end");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    execution.start(null, context);
    assertTrue(execution.hasStarted());
    assertFalse(execution.isActive());
    assertEquals(1, mockListener.getRequestsSubmittedCount());
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);
    assertTrue(execution.isActive());
    assertEquals(1, mockListener.getPausedCount());
  }
View Full Code Here

      }
    };
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    assertTrue(execution.isActive());
    assertEquals(1, mockListener.getPausedCount());
  }
View Full Code Here

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

      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw new IllegalStateException("Oops");
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    try {
      execution.start(null, context);
      fail("Should have failed");
    } catch (FlowExecutionException e) {
View Full Code Here

      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw e;
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    try {
      execution.start(null, context);
      fail("Should have failed");
    } catch (FlowExecutionException ex) {
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

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.