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/04/22 07:58:07 UTC

svn commit: r1589020 - in /tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test: InjectionTest.java ManagedExecutorServiceTest.java

Author: rmannibucau
Date: Tue Apr 22 05:58:07 2014
New Revision: 1589020

URL: http://svn.apache.org/r1589020
Log:
fixing tests

Modified:
    tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/InjectionTest.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/test/java/org/apache/openejb/concurrencyutilities/test/InjectionTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/InjectionTest.java?rev=1589020&r1=1589019&r2=1589020&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/InjectionTest.java (original)
+++ tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/InjectionTest.java Tue Apr 22 05:58:07 2014
@@ -25,6 +25,7 @@ import org.apache.openejb.jee.Enterprise
 import org.apache.openejb.jee.SingletonBean;
 import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Module;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -67,11 +68,19 @@ public class InjectionTest {
     @EJB
     private CUBean bean;
 
+    private ThreadContext ctx;
+
     @Before
     public void cleanUpContext() {
+        ctx = ThreadContext.getThreadContext();
         ThreadContext.exit(null);
     }
 
+    @After
+    public void reset() {
+        ThreadContext.enter(ctx);
+    }
+
     @Test
     public void checkInjections() {
         doCheck(es, ses, ces, tf);

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=1589020&r1=1589019&r2=1589020&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 Tue Apr 22 05:58:07 2014
@@ -19,6 +19,7 @@ package org.apache.openejb.concurrencyut
 import org.apache.openejb.core.ThreadContext;
 import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Module;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -49,12 +50,20 @@ public class ManagedExecutorServiceTest 
         return new Class<?>[]{ ExecutorFacade.class, CdiExecutorFacade.class, RequestBean.class, MyCallable.class };
     }
 
+    private ThreadContext ctx;
+
     @Before
     public void cleanUpContext() {
+        ctx = ThreadContext.getThreadContext();
         ThreadContext.exit(null);
         RequestBean.ID = 0;
     }
 
+    @After
+    public void reset() {
+        ThreadContext.enter(ctx);
+    }
+
     @Test
     public void checkEjbContext() throws Exception {
         assertTrue(facade.submit().get());