openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1366508 - in /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular: beans/CircularApplicationScopedBean.java beans/CircularDependentScopedBean.java tests/CircularInjectionTest.java
Date Fri, 27 Jul 2012 19:18:42 GMT
Author: struberg
Date: Fri Jul 27 19:18:42 2012
New Revision: 1366508

URL: http://svn.apache.org/viewvc?rev=1366508&view=rev
Log:
yikes, the other test as well...

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularApplicationScopedBean.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularDependentScopedBean.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/tests/CircularInjectionTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularApplicationScopedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularApplicationScopedBean.java?rev=1366508&r1=1366507&r2=1366508&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularApplicationScopedBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularApplicationScopedBean.java
Fri Jul 27 19:18:42 2012
@@ -32,7 +32,12 @@ public class CircularApplicationScopedBe
     
     public void hello()
     {
-        
+        // nothing to do
+    }
+
+    public void callDependent()
+    {
+        dependent.hello();
     }
     
     @PostConstruct

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularDependentScopedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularDependentScopedBean.java?rev=1366508&r1=1366507&r2=1366508&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularDependentScopedBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/beans/CircularDependentScopedBean.java
Fri Jul 27 19:18:42 2012
@@ -37,9 +37,15 @@ public class CircularDependentScopedBean
     @Transactional
     public void hello()
     {
+        // do nothing
+    }
+
+    public void callAppScoped()
+    {
         app.hello();
     }
-    
+
+
     @PostConstruct
     public void postConstruct()
     {

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/tests/CircularInjectionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/tests/CircularInjectionTest.java?rev=1366508&r1=1366507&r2=1366508&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/tests/CircularInjectionTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/injection/circular/tests/CircularInjectionTest.java
Fri Jul 27 19:18:42 2012
@@ -50,19 +50,9 @@ public class CircularInjectionTest exten
         beanClasses.add(CircularApplicationScopedBean.class);
         
         startContainer(beanClasses, beanXmls);
-        
-        Set<Bean<?>> beans = getBeanManager().getBeans("org.apache.webbeans.newtests.injection.circular.beans.CircularApplicationScopedBean");
-        Assert.assertNotNull(beans);
-        
-        Bean<CircularApplicationScopedBean> dependentBean = (Bean<CircularApplicationScopedBean>)beans.iterator().next();
-        CreationalContext<CircularApplicationScopedBean> ctx = getBeanManager().createCreationalContext(dependentBean);
-        
-        Object reference = getBeanManager().getReference(dependentBean, CircularApplicationScopedBean.class,
ctx);
-        
-        Assert.assertTrue(reference instanceof CircularApplicationScopedBean);
-        
-        CircularApplicationScopedBean beanInstance = (CircularApplicationScopedBean)reference;
-        beanInstance.hello();
+
+        CircularApplicationScopedBean beanInstance = getInstance(CircularApplicationScopedBean.class);
+        beanInstance.callDependent();
         
         Assert.assertTrue(CircularDependentScopedBean.success);
         Assert.assertTrue(CircularApplicationScopedBean.success);
@@ -85,7 +75,7 @@ public class CircularInjectionTest exten
         CircularDependentScopedBean reference = getInstance(CircularDependentScopedBean.class);
         Assert.assertTrue(reference instanceof CircularDependentScopedBean);
 
-        reference.hello();
+        reference.callAppScoped();
                 
         Assert.assertTrue(CircularDependentScopedBean.success);
         Assert.assertTrue(CircularApplicationScopedBean.success);



Mime
View raw message