sleep after the latch to make sure the exception is there
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user