Package org.springframework.webflow.engine

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


    }
  }

  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

      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

            ((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

    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

    MockFlowBuilderContext childFlowContext = new MockFlowBuilderContext("managed-child-flow");
    FlowAssembler childFlowAssembler = new FlowAssembler(childFlowBuilder, childFlowContext);
    Flow childFlow = childFlowAssembler.assembleFlow();

    Flow notManaged = new Flow("notmanaged-child-flow");
    new EndState(notManaged, "finish");

    context.registerSubflow(childFlow);
    context.registerSubflow(notManaged);

    Action incrementCountAction = incrementCountAction();
View Full Code Here

    TestBean bean = new TestBean("Keith Donald");
    hibernateTemplate.save(bean);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
    endState.getAttributes().put("commit", true);
    flowSession.setState(endState);

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

    TestBean bean2 = new TestBean("Keith Donald");
    hibernateTemplate.save(bean2);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionBound();

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "success");
    endState.getAttributes().put("commit", true);
    flowSession.setState(endState);

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

    TestBean bean = new TestBean("Keith Donald");
    hibernateTemplate.save(bean);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));

    EndState endState = new EndState(flowSession.getDefinitionInternal(), "cancel");
    endState.getAttributes().put("commit", false);
    flowSession.setState(endState);
    hibernateListener.sessionEnding(context, flowSession, "success", null);
    hibernateListener.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have two rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();
View Full Code Here

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

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

    hibernateListener.sessionEnding(context, flowSession, "success", null);
    hibernateListener.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have three rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
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.