Author: peteroyle
Date: 2009-11-29 23:33:32 -0500 (Sun, 29 Nov 2009)
New Revision: 5175
Modified:
java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java
Log:
Fixed the API for selecting events using Weld.event()
Modified: java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java 2009-11-30
03:42:28 UTC (rev 5174)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/Weld.java 2009-11-30
04:33:32 UTC (rev 5175)
@@ -89,7 +89,7 @@
return instanceManager.getInstances();
}
- public Instance<Event> event()
+ public Event<Object> event()
{
return instanceManager.getEvents();
}
Modified:
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java
===================================================================
---
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java 2009-11-30
03:42:28 UTC (rev 5174)
+++
java-se/trunk/src/main/java/org/jboss/weld/environment/se/beans/InstanceManager.java 2009-11-30
04:33:32 UTC (rev 5175)
@@ -33,7 +33,7 @@
{
@Inject Instance<Object> instances;
- @Inject Instance<Event> events;
+ @Inject Event<Object> events;
public InstanceManager()
{
@@ -44,7 +44,7 @@
return instances;
}
- public Instance<Event> getEvents()
+ public Event<Object> getEvents()
{
return events;
}
Modified:
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java
===================================================================
---
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java 2009-11-30
03:42:28 UTC (rev 5174)
+++
java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/WeldMainTest.java 2009-11-30
04:33:32 UTC (rev 5175)
@@ -65,9 +65,7 @@
ObserverTestBean.reset();
Weld weld = new Weld().initialize();
- weld.getBeanManager().fireEvent(new CustomEvent());
-// TODO(PR): this should work. What's with the compile error?
-// weld.event().select(CustomEvent.class).fire(new CustomEvent());
+ weld.event().select(CustomEvent.class).fire(new CustomEvent());
Assert.assertTrue(ObserverTestBean.isBuiltInObserved());
Assert.assertTrue(ObserverTestBean.isCustomObserved());
Show replies by date