This content has been marked as final.
Show 2 replies
-
1. Weld Event Testing
aslak Apr 27, 2011 3:28 PM (in response to toddpi314)That's true.
The TestClass is only non contextual injected for @Inject support, it's not ran in JUnit as a Bean, but it's whithin the BeanArchive so if need be, CDI will create a instance of it(e.g. by the use of @Produces or @Observes), but this is as you state not the same instance as JUnit use.
You need to use statics, or move the Observer out from the TestClass for this to work as expected.
-
2. Weld Event Testing
toddpi314 Apr 27, 2011 3:46 PM (in response to aslak)Static worked just fine.
It should be said that all of my events are firing reliably. I have ~30 so far across 6 modules and I haven't run into any behaviorial bugs.
Great work!