Examples of EndState


Examples of org.springframework.webflow.engine.EndState

  }

  public class SimpleFlowBuilder extends AbstractFlowBuilder implements FlowBuilder {

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

Examples of org.springframework.webflow.engine.EndState

    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

Examples of org.springframework.webflow.engine.EndState

*/
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

Examples of org.springframework.webflow.engine.EndState

    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

Examples of org.springframework.webflow.engine.EndState

      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

Examples of org.springframework.webflow.engine.EndState

    assertEquals(2, exceptionHandler.getHandleCount());
  }

  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);
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    }
  }

  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);
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

      public void resume(RequestControlContext context) {
        context.execute(getRequiredTransition(context));
      }
    };
    state.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("finish")));
    new EndState(flow, "finish");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    execution.setKeyFactory(new MockFlowExecutionKeyFactory());
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

            ((AttributeMap<Object>) source).get("id"));
        return null;
      }
    });
    // test responding to finish result
    new EndState(mockDetailFlow, "finish");
    builderContext.registerSubflow(mockDetailFlow);
    builderContext.registerBean("phonebook", new TestPhoneBook());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    MockFlowSession flowSession = new MockFlowSession();
    flowSession.setParent(parent);
    if (persistenceContext) {
      flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
    }
    EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
    endState.getAttributes().put("commit", true);
    flowSession.setState(endState);
    return flowSession;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.