public void testDelayListener() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
final CountDownLatch latch2 = new CountDownLatch(1);
WorkListener listener = createStrictMock(WorkListener.class);
listener.workAccepted(isA(WorkEvent.class));
listener.workStarted(isA(WorkEvent.class));
listener.workCompleted(isA(WorkEvent.class));
expectLastCall().andStubAnswer(new IAnswer<Object>() {
public Object answer() throws Throwable {
latch2.countDown();
return null;