Author: shawkins
Date: 2009-03-31 21:10:40 -0400 (Tue, 31 Mar 2009)
New Revision: 680
Modified:
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
Log:
TEIID-445 fix for re-executing a failed task
Modified:
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
===================================================================
---
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-01
01:09:19 UTC (rev 679)
+++
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-01
01:10:40 UTC (rev 680)
@@ -29,6 +29,7 @@
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Test;
@@ -151,5 +152,19 @@
future.cancel(true);
assertEquals(10, result.size());
}
+
+ @Test public void testFailingWork() throws Exception {
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final AtomicInteger count = new AtomicInteger();
+ pool.execute(new Runnable() {
+ @Override
+ public void run() {
+ count.getAndIncrement();
+ throw new RuntimeException();
+ }
+ });
+ Thread.sleep(10);
+ assertEquals(1, count.get());
+ }
}