Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.EndState


    flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
    jpaListener.sessionStarting(context, flowSession, null);
    context.setActiveSession(flowSession);
    assertSessionBound();

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel");
    flowSession.setState(endState);

    jpaListener.sessionEnding(context, flowSession, "cancel", null);
    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have three rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
View Full Code Here


    e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new RuntimeException());
    assertTrue("Doesn't handle state exception", handler.canHandle(e));
  }

  public void testFlowStateExceptionHandlingTransition() {
    new EndState(flow, "end");
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
      @SuppressWarnings("unused")
View Full Code Here

  }

  public void testStateExceptionHandlingExceptionInEndState() {
    FlowBuilder builder = new AbstractFlowBuilder() {
      public void buildStates() throws FlowBuilderException {
        State state = new EndState(getFlow(), "end");
        state.getEntryActionList().add(new AbstractAction() {
          protected Event doExecute(RequestContext context) throws Exception {
            throw new NullPointerException("failing");
          }
        });
        new TransitionableState(getFlow(), "showError") {
View Full Code Here

  private boolean removeAllSnapshotsCalled;

  public void setUp() {
    flowDefinition = new Flow("flow");
    new EndState(flowDefinition, "end");
  }
View Full Code Here

  private class SimpleFlowDefinitionLocator implements FlowDefinitionLocator {
    Flow child = new Flow("child");

    public SimpleFlowDefinitionLocator() {
      new EndState(child, "state");
    }
View Full Code Here

  }

  public class SimpleFlowBuilder extends AbstractFlowBuilder implements FlowBuilder {

    public void buildStates() throws FlowBuilderException {
      new EndState(getFlow(), "end");
    }
View Full Code Here

    assertNull(model.get(BindingResult.MODEL_KEY_PREFIX + "bindBean"));
  }

  public void testRenderNoKey() throws Exception {
    MockRequestControlContext context = new MockRequestControlContext();
    EndState endState = new EndState(context.getRootFlow(), "end");
    endState.setFinalResponseAction(new ViewFactoryActionAdapter(new StubViewFactory()));
    context.setCurrentState(endState);
    context.getRequestScope().put("foo", "bar");
    context.getFlowScope().put("bar", "baz");
    context.getFlowScope().put("bindBean", new BindBean());
    context.getConversationScope().put("baz", "boop");
View Full Code Here

*/
public class FlowExecutionImplTests extends TestCase {

  public void testStartAndEnd() {
    Flow flow = new Flow("flow");
    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();
View Full Code Here

    assertEquals(0, mockListener.getFlowNestingLevel());
  }

  public void testStartAndEndSavedMessages() {
    Flow flow = new Flow("flow");
    new EndState(flow, "end");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener() {
      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap<?> input) {
        super.sessionStarting(context, session, input);
        context.getMessageContext().addMessage(new MessageBuilder().source("foo").defaultText("bar").build());
      }
View Full Code Here

      public void handle(FlowExecutionException exception, RequestControlContext context) {
        throw new UnsupportedOperationException("Should not be called");
      }

    });
    new EndState(flow, "end");
    FlowExecutionListener mockListener = new FlowExecutionListenerAdapter() {
      public void sessionCreating(RequestContext context, FlowDefinition definition) {
        assertFalse(context.getFlowExecutionContext().isActive());
        throw new IllegalStateException("Oops");
      }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.EndState

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.