sleep after the latch to make sure the exception is there

This commit is contained in:
Jonas Partner
2008-10-30 14:38:32 +00:00
parent efa42f761a
commit 81629363a9

View File

@@ -49,6 +49,7 @@ public class ErrorHandlingExecutorBeanPostProcessorTests {
ErrorThrowingRunnable runnable = new ErrorThrowingRunnable();
taskExecutor.execute(runnable);
assertTrue("Runnable faield to run",runnable.latch.await(5, TimeUnit.SECONDS));
Thread.sleep(100);
assertEquals("Incorrect count of exceptions", 1, errorHandler.throwables.size());
}
@@ -58,6 +59,7 @@ public class ErrorHandlingExecutorBeanPostProcessorTests {
ErrorThrowingRunnable runnable = new ErrorThrowingRunnable();
taskExecutor.execute(runnable);
assertTrue("Runnable faield to run",runnable.latch.await(5, TimeUnit.SECONDS));
Thread.sleep(100);
assertEquals("Incorrect count of exceptions", 0, errorHandler.throwables.size());
}
@@ -68,7 +70,6 @@ public class ErrorHandlingExecutorBeanPostProcessorTests {
public void run() {
latch.countDown();
throw new RuntimeException();
}
}