You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2014/05/24 19:59:13 UTC
svn commit: r1597332 - in
/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src:
main/java/org/apache/openejb/concurrencyutilities/ee/impl/
test/java/org/apache/openejb/concurrencyutilities/test/
Author: rmannibucau
Date: Sat May 24 17:59:13 2014
New Revision: 1597332
URL: http://svn.apache.org/r1597332
Log:
stupid completion issue in ee concurrency utilities
Modified:
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/main/java/org/apache/openejb/concurrencyutilities/ee/impl/ManagedExecutorServiceImpl.java
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedExecutorServiceTest.java
Modified: tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/main/java/org/apache/openejb/concurrencyutilities/ee/impl/ManagedExecutorServiceImpl.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/main/java/org/apache/openejb/concurrencyutilities/ee/impl/ManagedExecutorServiceImpl.java?rev=1597332&r1=1597331&r2=1597332&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/main/java/org/apache/openejb/concurrencyutilities/ee/impl/ManagedExecutorServiceImpl.java (original)
+++ tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/main/java/org/apache/openejb/concurrencyutilities/ee/impl/ManagedExecutorServiceImpl.java Sat May 24 17:59:13 2014
@@ -89,7 +89,7 @@ public class ManagedExecutorServiceImpl
final CURunnable wrapper = new CURunnable(task);
final Future<?> future = delegate.submit(wrapper);
wrapper.taskSubmitted(future, this, task);
- return new CUFuture<Void>(CUFuture.class.cast(future), wrapper);
+ return new CUFuture<Void>(Future.class.cast(future), wrapper);
}
@Override
Modified: tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedExecutorServiceTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedExecutorServiceTest.java?rev=1597332&r1=1597331&r2=1597332&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedExecutorServiceTest.java (original)
+++ tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedExecutorServiceTest.java Sat May 24 17:59:13 2014
@@ -33,7 +33,9 @@ import javax.enterprise.inject.Typed;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -76,6 +78,11 @@ public class ManagedExecutorServiceTest
// assertEquals(1, RequestBean.ID); // CDI is opposed to it in the spirit
}
+ @Test
+ public void runnable() throws Exception {
+ assertTrue(cdiFacade.submitRunnable());
+ }
+
@Singleton
@Typed(ExecutorFacade.class)
public static class ExecutorFacade extends CdiExecutorFacade {
@@ -106,6 +113,22 @@ public class ManagedExecutorServiceTest
return es.submit(callable);
}
+ public boolean submitRunnable() {
+ final CountDownLatch done = new CountDownLatch(1);
+ es.submit(new Runnable() {
+ @Override
+ public void run() {
+ done.countDown();
+ }
+ });
+ try {
+ done.await();
+ } catch (final InterruptedException e) {
+ Thread.interrupted();
+ }
+ return true;
+ }
+
protected void setContext() {
id = bean.getId();
current = this;