[webbeans-commits] Webbeans SVN: r3133 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/event/observer/checkedException and 7 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Jul 22 09:55:54 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-07-22 09:55:53 -0400 (Wed, 22 Jul 2009)
New Revision: 3133

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
MAtch observer exception tests, match specialization tests

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -4,7 +4,6 @@
 import java.util.ArrayList;
 import java.util.Set;
 
-import javax.enterprise.event.Observer;
 import javax.enterprise.inject.AnnotationLiteral;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.ObserverMethod;
@@ -316,7 +315,8 @@
 
    @Test(groups = { "events" })
    @SpecAssertions({
-      @SpecAssertion(section = "4.3.2", id = "a"),
+      @SpecAssertion(section = "4.3.2", id = "d"),
+      @SpecAssertion(section="4.3", id="cb"),
       @SpecAssertion(section = "5.6.8", id = "ba")
    })
    public void testObserverCalledOnMostSpecializedInstance()

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/checkedException/CheckedExceptionWrappedTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -35,7 +35,7 @@
 public class CheckedExceptionWrappedTest extends AbstractJSR299Test
 {
    @Test(groups = { "events" }, expectedExceptions = { ObserverException.class })
-   @SpecAssertion(section = "10.6.1", id = "review") // no longer described by spec
+   @SpecAssertion(section = "10.5", id = "cd")
    public void testNonTransactionalObserverThrowsCheckedExceptionIsWrappedAndRethrown()
    {
       getCurrentManager().fireEvent(new Integer(1));

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/runtimeException/ObserverExceptionRethrownTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -34,7 +34,7 @@
 public class ObserverExceptionRethrownTest extends AbstractJSR299Test
 {
    @Test(groups = { "events" }, expectedExceptions = { TeaCupPomeranian.OversizedException.class })
-   @SpecAssertion(section = "review", id = "review") // no longer described by spec?
+   @SpecAssertion(section = "10.5", id = "cc")
    public void testNonTransactionalObserverThrowsNonCheckedExceptionIsRethrown()
    {
       getCurrentManager().fireEvent("string event");

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -57,7 +57,6 @@
 
    @Test(groups = { "producerField" })
    @SpecAssertions({
-     @SpecAssertion(section = "4.3.2", id = "a"),
      @SpecAssertion(section = "5.6.7", id = "b"),
      @SpecAssertion(section = "7.3.5", id = "ga")
    })
@@ -76,7 +75,8 @@
 
    @Test(groups = { "producerField", "specialization" })
    @SpecAssertions({
-      @SpecAssertion(section = "4.3.2", id = "a")
+      @SpecAssertion(section = "4.3.2", id = "b"),
+      @SpecAssertion(section="4.3", id="cb")
    })
    public void testSpecializedBeanAlwaysUsed() throws Exception
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -73,7 +73,8 @@
    @Test(groups = { "producerMethod" })
    @SpecAssertions({
       @SpecAssertion(section = "4.3.2", id = "a"),
-      @SpecAssertion(section = "5.6.6", id = "c")
+      @SpecAssertion(section = "5.6.6", id = "c"),
+      @SpecAssertion(section="4.3", id="cb")
    })
    public void testProducerMethodFromMostSpecializedBeanUsed()
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -121,8 +121,7 @@
    @Test(groups = {"beanLifecycle", "broken"})
    @SpecAssertions({
       @SpecAssertion(section="2", id="g"),
-      @SpecAssertion(section="2.2.1", id="b"),
-      @SpecAssertion(section = "7", id = "d")
+      @SpecAssertion(section="2.2.1", id="b")
    })
    public void testCreateReturnsInstanceOfBean()
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -30,8 +30,7 @@
    
    @Test
    @SpecAssertions({
-     @SpecAssertion(section = "3.2.4", id = "review"), // removed from spec?
-     @SpecAssertion(section = "3.2.4", id = "review")
+     @SpecAssertion(section = "4.3", id = "ca")
    })
    public void testSpecializedBeanNotInstantiated() throws Exception
    {
@@ -50,7 +49,10 @@
    
    
    @Test
-   @SpecAssertion(section="review", id = "review") // removed from spec?
+   @SpecAssertions({
+      @SpecAssertion(section="4.3.2", id = "a"),
+      @SpecAssertion(section="4.3.1", id ="cb")
+   })
    public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws Exception
    {
       new RunInDependentContext()

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java	2009-07-22 13:55:53 UTC (rev 3133)
@@ -55,7 +55,8 @@
 
    @Test
    @SpecAssertions( { 
-      @SpecAssertion(section = "4.3.2", id = "a")
+      @SpecAssertion(section = "4.3.2", id = "a"),
+      @SpecAssertion(section="4.3", id="cb")
    })
    public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean()
    {

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-07-22 13:13:34 UTC (rev 3132)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-07-22 13:55:53 UTC (rev 3133)
@@ -1582,8 +1582,12 @@
     </assertion>
 
     <assertion id="ca">
-      <text>The only way one bean can completely override a lower-priority bean at all injection points is if it implements all the bean types and declares all the bindings of the lower-priority bean. However, if the lower-priority bean declares a producer method or observer method, then even this is not enough to ensure that the lower-priority bean is never called.</text>
+      <text>When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container.</text>
     </assertion>
+    
+    <assertion id="cb">
+      <text>When an enabled bean specializes a second bean, we can be certain ~that the second bean is never instantiated or called by the container.~ Even if the second bean defines a producer or observer method, the method will be called upon an instance of the first bean. </text>
+    </assertion>
 
   </section>
 
@@ -1615,8 +1619,20 @@
 
   <section id="4.3.2" title="Most specialized enabled bean for a bean">
     <assertion id="a">
-      <text>Non-static producer methods, producer fields, disposal methods and observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+      <text>Non-static producer methods, ~producer fields, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text><assertion id="b">
+      <text>Non-static ~producer methods,~ producer fields~, disposal methods and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
     </assertion>
+    </assertion>
+    
+    
+    
+    <assertion id="c">
+      <text>Non-static ~producer methods, producer fields,~ disposal methods~ and observer methods~ of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+    </assertion>
+    
+    <assertion id="d">
+      <text>Non-static ~producer methods, producer fields, disposal methods and~ observer methods of a bean are invoked upon an instance of the most specialized enabled bean that specializes the bean, as defined by Section 5.6.6, "Invocation of producer or disposal methods", Section 5.6.7, "Access to producer field values" and Section 5.6.8, "Invocation of observer methods".</text>
+    </assertion>
 
   </section>
 
@@ -3746,12 +3762,20 @@
     </assertion>
 
     <assertion id="ca">
-      <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.  ~Otherwise, the exception aborts processing of the event.  No other observer methods of that event will be called.  The |fireEvent()| method rethrows the exception.  If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.~</text>
+      <text>Observers may throw exceptions. If an observer method is a transactional observer method, any exception is caught and logged by the container.</text>
     </assertion>
     
     <assertion id="cb">
-      <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~  Otherwise, the exception aborts processing of the event.  No other observer methods of that event will be called.  The |fireEvent()| method rethrows the exception.  If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
+      <text>Observers may throw exceptions. If an observer method is a transactional observer method, ~any exception is caught and logged by the container.~  Otherwise, the exception aborts processing of the event.</text>
     </assertion>
+    
+    <assertion id="cc">
+      <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container.  Otherwise, the exception aborts processing of the event.  No other observer methods of that event will be called.~  The |fireEvent()| method rethrows the exception.  ~If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|~.</text>
+    </assertion>
+    
+    <assertion id="cd">
+      <text>Observers may throw exceptions. ~If an observer method is a transactional observer method, any exception is caught and logged by the container.  Otherwise, the exception aborts processing of the event.  No other observer methods of that event will be called.  The |fireEvent()| method rethrows the exception.~  If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |ObserverException|.</text>
+    </assertion>
 
     <assertion id="f">
       <text>For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must call |getNotify()| and |getTransactionPhase()| to determine is the observer method is a conditional or transactional observer method, and |notify()| to invoke the method.</text>




More information about the weld-commits mailing list