Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.State


  }

  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


    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }

  public void testCreateWithExecutionKeyFactory() {
    State state = new State(flowDefinition, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        context.assignFlowExecutionKey();
        context.updateCurrentFlowExecutionSnapshot();
        context.removeCurrentFlowExecutionSnapshot();
        context.removeAllFlowExecutionSnapshots();
View Full Code Here

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

  public void testStartAndPause() {
    Flow flow = new Flow("flow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        // no op
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
View Full Code Here

    assertEquals(1, mockListener.getPausedCount());
  }

  public void testStartWithNullInputMap() {
    Flow flow = new Flow("flow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        // no op
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener() {
View Full Code Here

    }
  }

  public void testStartExceptionThrownByState() {
    Flow flow = new Flow("flow");
    State state = new State(flow, "state") {
      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) {
      assertEquals(flow.getId(), e.getFlowId());
      assertEquals(state.getId(), e.getStateId());
    }
  }
View Full Code Here

  }

  public void testStartFlowExecutionExceptionThrown() {
    Flow flow = new Flow("flow");
    final FlowExecutionException e = new FlowExecutionException("flow", "state", "Oops");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw e;
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
View Full Code Here

    assertEquals(2, mockListener.getPausedCount());
  }

  public void testResumeNotAViewState() {
    Flow flow = new Flow("flow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        // no-op
      }
    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
View Full Code Here

  private ConversationManager conversationManager;
  private DefaultFlowExecutionRepository repository;

  protected void setUp() throws Exception {
    flow = new Flow("myFlow");
    new State(flow, "state") {
      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        context.assignFlowExecutionKey();
      }
    };
    conversationManager = new StubConversationManager();
View Full Code Here

      session = getActiveSessionInternal();
    } else {
      session = activateSession(flow);
      started = true;
    }
    State state = session.getFlow().getStateInstance(stateId);
    session.setCurrentState(state);
  }
View Full Code Here

  }

  void setCurrentState(State newState, RequestContext context) {
    listeners.fireStateEntering(context, newState);
    FlowSessionImpl session = getActiveSessionInternal();
    State previousState = (State) session.getState();
    session.setCurrentState(newState);
    listeners.fireStateEntered(context, previousState);
  }
View Full Code Here

TOP

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

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.