Digging into a test that essentially has two observer methods and is asserting
that only one of them are called.
public void observeElephantSessionBean(@Observes
ProcessSessionBean<Elephant> event)
{
ProcessBeanObserver.elephantProcessSessionBean = event;
}
public void observeElephantBean(@Observes ProcessBean<Elephant> event)
{
ProcessBeanObserver.elephantProcessBeanCount++;
}
The test is asserting that observeElephantSessionBean is called and that
observeElephantBean is not called.
Currently we call both because ProcessSessionBean is assignable to ProcessBean.
Anyone know what part of the spec might lead to this kind of requirement? The
spec seems to say in 10.4 pretty clearly:
There may be arbitrarily many observer methods with the same event parameter
type and qualifiers.
A bean (or extension) may declare multiple observer methods.
For the interested, the test is
org.jboss.jsr299.tck.tests.extensions.processBean.ProcessSessionBeanTest.testProcessSessionBeanEvent
-David