}
}
public void testResumeFlowExecutionException() {
Flow flow = new Flow("flow");
ViewState state = new ViewState(flow, "view", new StubViewFactory()) {
public void resume(RequestControlContext context) {
throw new FlowExecutionException("flow", "view", "oops");
}
};
MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
FlowExecutionImpl execution = new FlowExecutionImpl(flow);
execution.setListeners(listeners);
execution.setKeyFactory(new MockFlowExecutionKeyFactory());
MockExternalContext context = new MockExternalContext();
execution.start(null, context);
context = new MockExternalContext();
try {
execution.resume(context);
} catch (FlowExecutionException e) {
assertEquals(flow.getId(), e.getFlowId());
assertEquals(state.getId(), e.getStateId());
assertEquals(1, mockListener.getResumingCount());
assertEquals(2, mockListener.getPausedCount());
}
}