Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Flow


    RequestContext ctx = getRequestContext();
    assertFalse("Criterion should evaluate to false", criterion.test(ctx));
  }

  private MockRequestContext getRequestContext() {
    Flow flow = new Flow("id");
    MockRequestContext ctx = new MockRequestContext(flow);
    RequestContextHolder.setRequestContext(ctx);
    ctx.getFlowScope().put("foo", "bar");
    ctx.setCurrentEvent(new Event(this, "sample"));
    return ctx;
View Full Code Here


public class SecurityFlowExecutionListenerTests extends TestCase {

  public void testSessionCreatingNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    FlowDefinition definition = new Flow("flow");
    listener.sessionCreating(context, definition);
  }
View Full Code Here

  }

  public void testSessionCreatingWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    SecurityRule rule = getSecurityRuleAnyAuthorized();
    flow.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.sessionCreating(context, flow);
  }
View Full Code Here

  }

  public void testStateEnteringNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    listener.stateEntering(context, state);
  }
View Full Code Here

  }

  public void testStateEnteringWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    SecurityRule rule = getSecurityRuleAllAuthorized();
    state.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.stateEntering(context, state);
View Full Code Here

    builder.buildStates();
    builder.buildGlobalTransitions();
    builder.buildEndActions();
    builder.buildOutputMapper();
    builder.buildExceptionHandlers();
    EasyMock.expect(builder.getFlow()).andReturn(new Flow("search"));
    EasyMock.replay(new Object[] { builder });
    Flow flow = assembler.assembleFlow();
    assertEquals("search", flow.getId());
    EasyMock.verify(new Object[] { builder });
  }
View Full Code Here

  }

  private class MockViewState extends ViewState {

    public MockViewState() {
      super(new Flow("mockFlow"), "mockView", new ViewFactory() {

        public View getView(RequestContext context) {
          throw new UnsupportedOperationException();
        }
      });
View Full Code Here

* @author Jeremy Grelle
*/
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);
View Full Code Here

    assertEquals(0, mockListener.getExceptionThrownCount());
    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

    resumeFlow(context);
    assertCurrentStateEquals("displayResults");
  }

  protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
    Flow mockDetailFlow = new Flow("detail-flow");
    mockDetailFlow.setInputMapper(new Mapper() {
      @SuppressWarnings("unchecked")
      public MappingResults map(Object source, Object target) {
        assertEquals("id of value 1 not provided as input by calling search flow", new Long(1),
            ((AttributeMap<Object>) source).get("id"));
        return null;
View Full Code Here

TOP

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

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.