Author: dallen6
Date: 2008-12-08 17:44:28 -0500 (Mon, 08 Dec 2008)
New Revision: 487
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
Log:
Added a couple more test implementations for event bus.
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-08
21:46:17 UTC (rev 486)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-08
22:44:28 UTC (rev 487)
@@ -18,6 +18,7 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.test.beans.BananaSpider;
import org.jboss.webbeans.test.beans.RecluseSpider;
+import org.jboss.webbeans.test.beans.SweeWaxbill;
import org.jboss.webbeans.test.beans.TeaCupPomeranian;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.RoleBinding;
@@ -567,18 +568,24 @@
manager.fireEvent(new Integer(1));
}
- @Test(groups = { "stub", "events" })
+ @Test(groups = { "broken", "events" }, expectedExceptions = {
DuplicateBindingTypeException.class })
@SpecAssertion(section = "8.6")
public void testDuplicateBindingsToFireFails()
{
- assert false;
+ Set<AbstractBean<?, ?>> beans =
webBeansBootstrap.createBeans(SweeWaxbill.class);
+ assert beans.size() == 1;
+ SweeWaxbill bean = (SweeWaxbill)beans.iterator().next().create();
+ bean.methodThatFiresEvent();
}
- @Test(groups = { "stub", "events" })
+ @Test(groups = { "broken", "events" })
@SpecAssertion(section = "8.6")
public void testDuplicateBindingsToObservesFails()
{
- assert false;
+ Set<AbstractBean<?, ?>> beans =
webBeansBootstrap.createBeans(SweeWaxbill.class);
+ assert beans.size() == 1;
+ SweeWaxbill bean = (SweeWaxbill)beans.iterator().next().create();
+ bean.methodThatRegistersObserver();
}
@Test(groups = { "stub", "events" })
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java 2008-12-08
22:44:28 UTC (rev 487)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Event;
+import javax.webbeans.Observable;
+import javax.webbeans.Observer;
+
+import org.jboss.webbeans.test.annotations.Role;
+import org.jboss.webbeans.test.bindings.RoleBinding;
+
+public class SweeWaxbill
+{
+ @Observable
+ @Role("Admin")
+ private Event<String> simpleEvent;
+
+ public void methodThatFiresEvent()
+ {
+ simpleEvent.fire("An event", new RoleBinding("Admin"));
+ }
+
+ public void methodThatRegistersObserver()
+ {
+ simpleEvent.observe(new Observer<String>()
+ {
+
+ public void notify(String event)
+ {
+ }
+ }, new RoleBinding("Admin"));
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain