public void testErrorListener() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
WorkListener listener = createStrictMock(WorkListener.class);
listener.workAccepted(isA(WorkEvent.class));
listener.workStarted(isA(WorkEvent.class));
listener.workCompleted(isA(WorkEvent.class));
replay(listener);
Work work = createMock(Work.class);
work.run();
expectLastCall().andStubAnswer(new IAnswer<Object>() {
public Object answer() throws Throwable {