Examples of FlowExecutionException


Examples of org.springframework.webflow.execution.FlowExecutionException

  private FlowExecutionException wrap(Exception e) {
    if (isActive()) {
      FlowSession session = getActiveSession();
      String flowId = session.getDefinition().getId();
      String stateId = session.getState() != null ? session.getState().getId() : null;
      return new FlowExecutionException(flowId, stateId, "Exception thrown in state '" + stateId + "' of flow '"
          + flowId + "'", e);
    } else {
      return new FlowExecutionException(flow.getId(), null, "Exception thrown within inactive flow '"
          + flow.getId() + "'", e);
    }
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionException

    TestBean bean = new TestBean(1, "Keith Donald");
    EntityManager em = EntityManagerFactoryUtils.getTransactionalEntityManager(entityManagerFactory);
    em.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

Examples of org.springframework.webflow.execution.FlowExecutionException

    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

Examples of org.springframework.webflow.execution.FlowExecutionException

  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

Examples of org.springframework.webflow.execution.FlowExecutionException

  }

  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

Examples of org.springframework.webflow.execution.FlowExecutionException

  }

  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

Examples of org.springframework.webflow.execution.FlowExecutionException

      public void handle(FlowExecutionException exception, RequestControlContext context) {
        handled = true;
      }

    });
    FlowExecutionException e = new FlowExecutionException(flow.getId(), state.getId(), "Whatev");
    MockRequestControlContext context = new MockRequestControlContext(flow);
    assertTrue(state.handleException(e, context));
    assertTrue(handled);
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionException

    assertTrue(state.handleException(e, context));
    assertTrue(handled);
  }

  public void testCouldNotHandleException() {
    FlowExecutionException e = new FlowExecutionException(flow.getId(), state.getId(), "Whatev");
    MockRequestControlContext context = new MockRequestControlContext(flow);
    assertFalse(state.handleException(e, context));
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionException

  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

Examples of org.springframework.webflow.execution.FlowExecutionException

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