}
}
public void testStartExceptionThrownByState() {
Flow flow = new Flow("flow");
State state = new State(flow, "state") {
protected void doEnter(RequestControlContext context) throws FlowExecutionException {
throw new IllegalStateException("Oops");
}
};
FlowExecutionImpl execution = new FlowExecutionImpl(flow);
MockExternalContext context = new MockExternalContext();
assertFalse(execution.hasStarted());
try {
execution.start(null, context);
fail("Should have failed");
} catch (FlowExecutionException e) {
assertEquals(flow.getId(), e.getFlowId());
assertEquals(state.getId(), e.getStateId());
}
}