Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a couple more test implementations for event bus.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@487 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
2 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/SweeWaxbill.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")); | ||
} | ||
} |