public void testStartExceptionThrownByStateHandledByStateExceptionHandler() {
Flow flow = new Flow("flow");
flow.getExceptionHandlerSet().add(new StubFlowExecutionExceptionHandler());
final FlowExecutionException e = new FlowExecutionException("flow", "state", "Oops");
State s = new State(flow, "state") {
protected void doEnter(RequestControlContext context) throws FlowExecutionException {
throw e;
}
};
StubFlowExecutionExceptionHandler exceptionHandler = new StubFlowExecutionExceptionHandler();
s.getExceptionHandlerSet().add(exceptionHandler);
FlowExecutionImpl execution = new FlowExecutionImpl(flow);
MockExternalContext context = new MockExternalContext();
assertFalse(execution.hasStarted());
execution.start(null, context);
assertTrue(exceptionHandler.getHandled());