[webbeans-commits] Webbeans SVN: r1030 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Fri Jan 16 13:14:20 EST 2009


Author: dallen6
Date: 2009-01-16 13:14:20 -0500 (Fri, 16 Jan 2009)
New Revision: 1030

Removed:
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/RecluseSpider.java
Modified:
   ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
   tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java
   tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/RecluseSpider.java
Log:
Repaired many of the EventBus tests and allow AnnotationLiteral to compare values even if annotation is package scoped.

Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java	2009-01-16 18:00:17 UTC (rev 1029)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java	2009-01-16 18:14:20 UTC (rev 1030)
@@ -156,6 +156,10 @@
    {
       try
       {
+         if (!method.isAccessible())
+         {
+            method.setAccessible(true);
+         }
          return method.invoke(instance);
       }
       catch (IllegalArgumentException e)

Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/RecluseSpider.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/RecluseSpider.java	2009-01-16 18:00:17 UTC (rev 1029)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/RecluseSpider.java	2009-01-16 18:14:20 UTC (rev 1030)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.beans;
-
-import javax.webbeans.IfExists;
-import javax.webbeans.Observes;
-import javax.webbeans.RequestScoped;
-
-/**
- * Simple web bean that conditionally listens to events.
- *
- */
- at RequestScoped
-public class RecluseSpider
-{
-   public static boolean notified = false;
-   
-   public void observe(@Observes @IfExists String someEvent)
-   {
-      notified = true;
-   }
-}

Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java	2009-01-16 18:00:17 UTC (rev 1029)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/EventBusTest.java	2009-01-16 18:14:20 UTC (rev 1030)
@@ -113,7 +113,7 @@
       manager.fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
    }
 
-   @Test(groups = { "broken", "events" })
+   @Test(groups = { "events" })
    @SpecAssertion(section = "8.3")
    public void testManagerAddObserver()
    {
@@ -164,7 +164,7 @@
       assert foundObserver;
    }
 
-   @Test(groups = { "broken", "events" })
+   @Test(groups = { "events" })
    @SpecAssertion(section = "8.3")
    public void testManagerRemoveObserver()
    {
@@ -198,7 +198,7 @@
       assert resolvedObservers.isEmpty();
    }
 
-   @Test(groups = { "broken", "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
+   @Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
    @SpecAssertion(section = "8.3")
    public void testMultipleInstancesOfSameBindingTypeWhenAddingObserverFails()
    {
@@ -214,7 +214,7 @@
       manager.addObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
    }
 
-   @Test(groups = { "broken", "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
+   @Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
    @SpecAssertion(section = "8.3")
    public void testMultipleInstancesOfSameBindingTypeWhenRemovingObserverFails()
    {
@@ -435,7 +435,7 @@
     * Tests that a conditional observer is not notified of events until after it
     * is created by some other separate action.
     */
-   @Test(groups = { "broken", "events" })
+   @Test(groups = { "events" })
    @SpecAssertion(section = "8.5.5")
    public void testConditionalObserver()
    {
@@ -443,7 +443,7 @@
 
       manager.fireEvent("New string event");
       // Should not be notified since bean is not instantiated yet
-      assert !RecluseSpider.notified;
+      assert !RecluseSpider.isNotified();
       
       // Now instantiate the bean and fire another event
       try
@@ -453,7 +453,7 @@
          assert bean != null;
          
          manager.fireEvent("Another event");
-         assert RecluseSpider.notified;
+         assert RecluseSpider.isNotified();
       }
       finally
       {
@@ -556,7 +556,7 @@
       manager.fireEvent(new Integer(1));
    }
 
-   @Test(groups = { "broken", "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
+   @Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
    @SpecAssertion(section = "8.6")
    public void testDuplicateBindingsToFireFails()
    {
@@ -573,7 +573,7 @@
       }
    }
 
-   @Test(groups = { "broken", "events" }, expectedExceptions={ DuplicateBindingTypeException.class })
+   @Test(groups = { "events" }, expectedExceptions={ DuplicateBindingTypeException.class })
    @SpecAssertion(section = "8.6")
    public void testDuplicateBindingsToObservesFails()
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/RecluseSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/RecluseSpider.java	2009-01-16 18:00:17 UTC (rev 1029)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/tests/event/RecluseSpider.java	2009-01-16 18:14:20 UTC (rev 1030)
@@ -11,10 +11,15 @@
 @RequestScoped
 class RecluseSpider
 {
-   public static boolean notified = false;
+   private static boolean notified = false;
    
    public void observe(@Observes @IfExists String someEvent)
    {
       notified = true;
    }
+
+   public static boolean isNotified()
+   {
+      return notified;
+   }
 }




More information about the weld-commits mailing list