Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.EndState


      public MappingResults map(Object source, Object target) {
    assertEquals(new Long(1), ((AttributeMap) source).get("hotelId"));
    return null;
      }
  });
  new EndState(mockBookingFlow, "bookingConfirmed");
  getFlowDefinitionRegistry().registerFlowDefinition(mockBookingFlow);

  MockExternalContext context = new MockExternalContext();
  context.setEventId("book");
  resumeFlow(context);
View Full Code Here


    MockFlowBuilderContext context = new MockFlowBuilderContext("foo");
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
        Session session = (Session) context.getFlowScope().get("persistenceContext");
View Full Code Here

    MockFlowBuilderContext context = new MockFlowBuilderContext("foo");
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
        EntityManager em = (EntityManager) context.getFlowScope().get("persistenceContext");
View Full Code Here

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

    jpaListener.sessionEnded(context, flowSession, "success", null);
    assertEquals("Table should only have two rows", 2, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();
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", Boolean.TRUE);
    flowSession.setState(endState);

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

    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

    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

    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

    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

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.