[weld-commits] Weld SVN: r7116 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Dec 7 12:44:25 EST 2010


Author: pete.muir at jboss.org
Date: 2010-12-07 12:44:25 -0500 (Tue, 07 Dec 2010)
New Revision: 7116

Modified:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
Log:
CDITCK-183

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java	2010-12-07 17:43:15 UTC (rev 7115)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java	2010-12-07 17:44:25 UTC (rev 7116)
@@ -18,6 +18,7 @@
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.spi.Context;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.Bean;
 
@@ -44,10 +45,11 @@
       CreationalContext<MySessionBean> sessionCreationalContext = getCurrentManager().createCreationalContext(mySessionBean);
       MySessionBean beanInstance = mySessionBean.create(sessionCreationalContext);
       assert beanInstance != null;
-      destroyContext(getCurrentManager().getContext(SessionScoped.class));
-      setContextActive(getCurrentManager().getContext(SessionScoped.class));
+      Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
+      destroyContext(sessionContext);
+      setContextActive(sessionContext);
       
-      beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
+      beanInstance = sessionContext.get(mySessionBean);
       assert beanInstance == null;
       
       Bean<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
@@ -55,10 +57,11 @@
 
       MyApplicationBean myApplicationBeanInstance = myApplicationBean.create(applicationCreationalContext);
       assert myApplicationBeanInstance != null;
-      destroyContext(getCurrentManager().getContext(ApplicationScoped.class));
-      setContextActive(getCurrentManager().getContext(ApplicationScoped.class));
+      Context applicationContext = getCurrentManager().getContext(ApplicationScoped.class); 
+      destroyContext(applicationContext);
+      setContextActive(applicationContext);
 
-      myApplicationBeanInstance = getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean);
+      myApplicationBeanInstance = applicationContext.get(myApplicationBean);
       assert myApplicationBeanInstance == null;
    }
    



More information about the weld-commits mailing list