Examples of EndState


Examples of org.springframework.webflow.engine.EndState

    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", Boolean.TRUE);
    flowSession.setState(endState);

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

Examples of org.springframework.webflow.engine.EndState

    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", Boolean.FALSE);
    flowSession.setState(endState);
    hibernateListener.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have two rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();
    assertFalse(flowSession.getScope().contains("hibernate.session"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    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.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have three rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertFalse(flowSession.getScope().contains("hibernate.session"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    TestBean bean2 = new TestBean(2, "Keith Donald");
    jpaTemplate.persist(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", Boolean.TRUE);
    flowSession.setState(endState);

    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have three rows", 3, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertFalse(flowSession.getScope().contains("hibernate.session"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    TestBean bean = new TestBean(1, "Keith Donald");
    jpaTemplate.persist(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", Boolean.FALSE);
    flowSession.setState(endState);
    jpaListener.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have two rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();
    assertFalse(flowSession.getScope().contains("hibernate.session"));
View Full Code Here

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.sessionEnded(context, flowSession, "cancel", null);
    assertEquals("Table should only have three rows", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertFalse(flowSession.getScope().contains("hibernate.session"));
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

    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() {
      public void sessionEnding(RequestContext context, FlowSession session, MutableAttributeMap output) {
View Full Code Here

Examples of org.springframework.webflow.engine.EndState

  }

  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

Examples of org.springframework.webflow.engine.EndState

  private boolean removeAllSnapshotsCalled;

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

Examples of org.springframework.webflow.engine.EndState

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

    public SimpleFlowDefinitionLocator() {
      new EndState(child, "state");
    }
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.