openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1182572 - in /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable: ExtensionTest.java scopeextension/ExternalTestScopeExtension.java scopeextension/ExternalTestScopedBean.java
Date Wed, 12 Oct 2011 20:25:06 GMT
Author: struberg
Date: Wed Oct 12 20:25:05 2011
New Revision: 1182572

URL: http://svn.apache.org/viewvc?rev=1182572&view=rev
Log:
OWB-622 add unit test demoning that OWB can inject the BeanManager properly


Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopedBean.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java?rev=1182572&r1=1182571&r2=1182572&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
Wed Oct 12 20:25:05 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.webbeans.newtests.portable;
 
-import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -103,4 +102,5 @@ public class ExtensionTest extends Abstr
             // this is expected!
         }
     }
+
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java?rev=1182572&r1=1182571&r2=1182572&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
Wed Oct 12 20:25:05 2011
@@ -20,15 +20,21 @@ package org.apache.webbeans.newtests.por
 
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.BeforeBeanDiscovery;
 import javax.enterprise.inject.spi.Extension;
 
+import org.junit.Assert;
+
 
 public class ExternalTestScopeExtension implements Extension 
 {
 
-    public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
+    public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery, BeanManager
beanManager)
     {
+        // see OWB-622 it's expected that the BeanManager already exists even in BeforeBeanDiscovery.
+        Assert.assertNotNull(beanManager);
+
         beforeBeanDiscovery.addScope(ExternalTestScoped.class, true, true);
     }
     

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopedBean.java?rev=1182572&r1=1182571&r2=1182572&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopedBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopedBean.java
Wed Oct 12 20:25:05 2011
@@ -23,9 +23,9 @@ import java.io.Serializable;
 @ExternalTestScoped
 public class ExternalTestScopedBean implements Serializable{
 
-	private static final long serialVersionUID = -917790714891819356L;
-	
-	private int i = 0;
+    private static final long serialVersionUID = -917790714891819356L;
+
+    private int i = 0;
 
     public int getI() {
         return i;



Mime
View raw message