Skip to content

Commit

Permalink
Fixed the API for selecting events using Weld.event()
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroyle committed Nov 30, 2009
1 parent 6f8d971 commit 67ffb34
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/weld/environment/se/Weld.java
Expand Up @@ -89,7 +89,7 @@ public Instance<Object> instance()
return instanceManager.getInstances();
}

public Instance<Event> event()
public Event<Object> event()
{
return instanceManager.getEvents();
}
Expand Down
Expand Up @@ -33,7 +33,7 @@ public class InstanceManager
{

@Inject Instance<Object> instances;
@Inject Instance<Event> events;
@Inject Event<Object> events;

public InstanceManager()
{
Expand All @@ -44,7 +44,7 @@ public Instance<Object> getInstances()
return instances;
}

public Instance<Event> getEvents()
public Event<Object> getEvents()
{
return events;
}
Expand Down
Expand Up @@ -65,9 +65,7 @@ public void testObservers()
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());
Expand Down

0 comments on commit 67ffb34

Please sign in to comment.