[webbeans-commits] Webbeans SVN: r3235 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Jul 25 17:59:42 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-07-25 17:59:42 -0400 (Sat, 25 Jul 2009)
New Revision: 3235

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/Duck.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java
Removed:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor_Broken.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor_Broken.java
Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java
Log:
Fix ri

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2009-07-25 21:49:35 UTC (rev 3234)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -23,6 +23,8 @@
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Disposes;
 import javax.enterprise.inject.Initializer;
 import javax.enterprise.inject.spi.Decorator;
 
@@ -277,6 +279,7 @@
       if (!isInitialized())
       {
          initConstructor();
+         checkConstructor();
          super.initialize(environment);
          initPostConstruct();
          initPreDestroy();
@@ -369,6 +372,18 @@
          }
       }
    }
+   
+   protected void checkConstructor()
+   {
+      if (!constructor.getAnnotatedParameters(Disposes.class).isEmpty())
+      {
+         throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Disposes " + constructor);
+      }
+      if (!constructor.getAnnotatedParameters(Observes.class).isEmpty())
+      {
+         throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Observes " + constructor);
+      }
+   }
 
    @Override
    protected void preSpecialize(BeanDeployerEnvironment environment)

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java	2009-07-25 21:49:35 UTC (rev 3234)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/ConstructorHasDisposesParameterTest.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -17,7 +17,7 @@
 @ExpectedDeploymentException(DefinitionError.class)
 public class ConstructorHasDisposesParameterTest extends AbstractJSR299Test
 {
-   @Test(groups = { "disposalMethod", "ri-broken" })
+   @Test(groups = { "disposalMethod" })
    @SpecAssertion(section = "3.1.4.1", id = "da")
    public void testConstructorHasDisposesParameter() throws Exception
    {

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java (from rev 3215, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition.constructorHasDisposesParameter;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Initializer;
+
+class DisposingConstructor
+{
+   @Initializer
+   public DisposingConstructor(@Disposes Duck duck)
+   {
+      
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor_Broken.java	2009-07-25 21:49:35 UTC (rev 3234)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor_Broken.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.definition.constructorHasDisposesParameter;
-
-import javax.enterprise.inject.Disposes;
-
-class DisposingConstructor_Broken
-{
-   public DisposingConstructor_Broken(@Disposes Duck duck)
-   {
-      
-   }
-}

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java	2009-07-25 21:49:35 UTC (rev 3234)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ConstructorHasObservesParameterTest.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -17,7 +17,7 @@
 @ExpectedDeploymentException(DefinitionError.class)
 public class ConstructorHasObservesParameterTest extends AbstractJSR299Test
 {
-   @Test(groups = { "ri-broken", "observerMethod" })
+   @Test(groups = { "observerMethod" })
    @SpecAssertion(section = "3.1.4.1", id = "ea")
    public void testConstructorHasObservesParameter()
    {

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/Duck.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/Duck.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/Duck.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition.constructorHasObservesParameter;
+
+
+class Duck
+{
+      
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/Duck.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java (from rev 3215, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor_Broken.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition.constructorHasObservesParameter;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Initializer;
+
+class ObservingConstructor
+{
+
+   @Initializer
+   public ObservingConstructor(@Observes Duck duck)
+   {
+      
+   }
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor_Broken.java	2009-07-25 21:49:35 UTC (rev 3234)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor_Broken.java	2009-07-25 21:59:42 UTC (rev 3235)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.simple.definition.constructorHasObservesParameter;
-
-import javax.enterprise.event.Observes;
-
-class ObservingConstructor_Broken
-{
-
-   public ObservingConstructor_Broken(@Observes String stringEvent)
-   {
-      
-   }
-}




More information about the weld-commits mailing list