Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecutionException


    assertSessionBound();

    TestBean bean1 = new TestBean("Keith Donald");
    hibernateTemplate.save(bean1);
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    hibernateListener.exceptionThrown(context, new FlowExecutionException("bla", "bla", "bla"));
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();

  }
View Full Code Here


    assertEquals("Table should only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    MockRequestContext context = new MockRequestContext();
    MockFlowSession flowSession = new MockFlowSession();
    flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
    assertSessionNotBound();
    hibernateListener.exceptionThrown(context, new FlowExecutionException("foo", "bar", "test"));
    assertSessionNotBound();
  }
View Full Code Here

    assertSessionBound();

    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"));
    jpaListener.exceptionThrown(context, new FlowExecutionException("bla", "bla", "bla"));
    assertEquals("Table should still only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    assertSessionNotBound();

  }
View Full Code Here

    assertEquals("Table should only have one row", 1, jdbcTemplate.queryForInt("select count(*) from T_BEAN"));
    MockRequestContext context = new MockRequestContext();
    MockFlowSession flowSession = new MockFlowSession();
    flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
    assertSessionNotBound();
    jpaListener.exceptionThrown(context, new FlowExecutionException("foo", "bar", "test"));
    assertSessionNotBound();
  }
View Full Code Here

  protected void setUp() {
    flow = new Flow("myFlow");
    state = new TransitionableState(flow, "state1") {
      protected void doEnter(RequestControlContext context) {
        throw new FlowExecutionException(getFlow().getId(), getId(), "Oops!", new TestException());
      }
    };
    state.getTransitionSet().add(new Transition(toState("end")));
  }
View Full Code Here

  }

  public void testTransitionExecutorHandlesExceptionExactMatch() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "state");
    FlowExecutionException e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops",
        new TestException());
    assertTrue("Doesn't handle state exception", handler.canHandle(e));

    e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new Exception());
    assertFalse("Shouldn't handle exception", handler.canHandle(e));
  }
View Full Code Here

  }

  public void testTransitionExecutorHandlesExceptionSuperclassMatch() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(Exception.class, "state");
    FlowExecutionException e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops",
        new TestException());
    assertTrue("Doesn't handle state exception", handler.canHandle(e));
    e = new FlowExecutionException(state.getOwner().getId(), state.getId(), "Oops", new RuntimeException());
    assertTrue("Doesn't handle state exception", handler.canHandle(e));
  }
View Full Code Here

  public void testHandleException() {
    flow.getExceptionHandlerSet().add(
        new TransitionExecutingFlowExecutionExceptionHandler().add(TestException.class, "myState2"));
    MockRequestControlContext context = new MockRequestControlContext(flow);
    context.setCurrentState(flow.getStateInstance("myState1"));
    FlowExecutionException e = new FlowExecutionException(flow.getId(), flow.getStartState().getId(), "Oops!",
        new TestException());
    flow.handleException(e, context);
    assertFalse(context.getFlowExecutionContext().isActive());
  }
View Full Code Here

    assertFalse(context.getFlowExecutionContext().isActive());
  }

  public void testHandleExceptionNoMatch() {
    MockRequestControlContext context = new MockRequestControlContext(flow);
    FlowExecutionException e = new FlowExecutionException(flow.getId(), flow.getStartState().getId(), "Oops!",
        new TestException());
    try {
      flow.handleException(e, context);
    } catch (FlowExecutionException ex) {
      // expected
View Full Code Here

    FlowExecutionExceptionHandlerSet handlerSet = new FlowExecutionExceptionHandlerSet();
    handlerSet.add(new TestStateExceptionHandler(NullPointerException.class, "null"));
    handlerSet.add(new TestStateExceptionHandler(FlowExecutionException.class, "execution 1"));
    handlerSet.add(new TestStateExceptionHandler(FlowExecutionException.class, "execution 2"));
    assertEquals(3, handlerSet.size());
    FlowExecutionException e = new FlowExecutionException("flowId", "stateId", "Test");
    assertTrue(handlerSet.handleException(e, context));
    assertFalse(context.getFlowScope().contains("null"));
    assertTrue(context.getFlowScope().contains("execution 1"));
    assertFalse(context.getFlowScope().contains("execution 2"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.FlowExecutionException

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.