openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1435752 - in /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: component/exception/InnerComponent.java unittests/exception/ExceptionComponentTest.java
Date Sat, 19 Jan 2013 23:04:53 GMT
Author: struberg
Date: Sat Jan 19 23:04:53 2013
New Revision: 1435752

URL: http://svn.apache.org/viewvc?rev=1435752&view=rev
Log:
OWB-344 fix remaining component-validation tests

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/InnerComponent.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/InnerComponent.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/InnerComponent.java?rev=1435752&r1=1435751&r2=1435752&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/InnerComponent.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/InnerComponent.java
Sat Jan 19 23:04:53 2013
@@ -21,7 +21,10 @@ package org.apache.webbeans.test.compone
 
 public class InnerComponent
 {
-        public class InnerInnerComponent
+    /**
+     * only static inner classes get picked up as CDI beans as per 3.1.1
+     */
+    public class InnerInnerComponent
     {
 
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java?rev=1435752&r1=1435751&r2=1435752&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
Sat Jan 19 23:04:53 2013
@@ -19,32 +19,15 @@
 package org.apache.webbeans.test.unittests.exception;
 
 
+import javax.enterprise.inject.spi.Bean;
+
+import java.util.Set;
+
 import junit.framework.Assert;
 
-import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.newtests.AbstractUnitTest;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithFinalMethodComponent;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithSameMethodNameComponent;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithStaticMethodComponent;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithWrongReturnTypeComponent;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithoutParameterComponent;
-import org.apache.webbeans.test.component.exception.AroundInvokeWithoutReturnTypeComponent;
-import org.apache.webbeans.test.component.exception.FinalComponent;
-import org.apache.webbeans.test.component.exception.HasFinalMethodComponent;
-import org.apache.webbeans.test.component.exception.MoreThanOneAroundInvokeComponent;
-import org.apache.webbeans.test.component.exception.MoreThanOneConstructureComponent;
-import org.apache.webbeans.test.component.exception.MoreThanOneConstructureComponent2;
-import org.apache.webbeans.test.component.exception.MoreThanOnePostConstructComponent;
-import org.apache.webbeans.test.component.exception.MultipleDisposalMethodComponent;
-import org.apache.webbeans.test.component.exception.NewComponentBindingComponent;
-import org.apache.webbeans.test.component.exception.NoConstructureComponent;
-import org.apache.webbeans.test.component.exception.PostContructMethodHasCheckedExceptionComponent;
-import org.apache.webbeans.test.component.exception.PostContructMethodHasParameterComponent;
-import org.apache.webbeans.test.component.exception.PostContructMethodHasReturnTypeComponent;
-import org.apache.webbeans.test.component.exception.PostContructMethodHasStaticComponent;
-import org.apache.webbeans.test.component.exception.ProducerTypeStaticComponent;
-import org.apache.webbeans.test.component.exception.InnerComponent.InnerInnerComponent;
+import org.apache.webbeans.test.component.exception.*;
 import org.apache.webbeans.test.component.intercept.NoArgConstructorInterceptorComponent;
 import org.junit.Test;
 
@@ -59,34 +42,14 @@ public class ExceptionComponentTest exte
     }
 
     @Test
-    public void testAbstract()
-    {
-        try
-        {
-            startContainer(AbstractOwbBean.class);
-        }
-        catch (WebBeansConfigurationException e)
-        {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
-        }
-        Assert.fail("expecting an exception!");
-        shutDownContainer();
-    }
-
-    @Test
     public void testInner()
     {
-        try
-        {
-            startContainer(InnerInnerComponent.class);
-        }
-        catch (WebBeansConfigurationException e)
-        {
-            System.out.println("got expected exception: " + e.getMessage());
-            return; // all ok!
-        }
-        Assert.fail("expecting an exception!");
+        startContainer(InnerComponent.class);
+
+        // this should not have been picked up as managed bean according to CDI-1.0 paragraph
3.1.1
+        Set<Bean<?>> innerinnerComponentBeans = getBeanManager().getBeans(InnerComponent.InnerInnerComponent.class);
+        Assert.assertNotNull(innerinnerComponentBeans);
+        Assert.assertEquals(0, innerinnerComponentBeans.size());
         shutDownContainer();
     }
 



Mime
View raw message