[weld-issues] [JBoss JIRA] Commented: (CDITCK-215) ProcessSessionBeanTest testProcessSessionBeanEvent count

Gurkan Erdogdu (JIRA) jira-events at lists.jboss.org
Thu Jun 9 18:19:59 EDT 2011


    [ https://issues.jboss.org/browse/CDITCK-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607665#comment-12607665 ] 

Gurkan Erdogdu commented on CDITCK-215:
---------------------------------------

10.2
An event is delivered to an observer method if:
• The event object is assignable to the observed event type, taking type parameters into consideration.

EvenType is ProcessSessionBean, Observed event type is ProcessBean.
ProcessSessionBean.isAssignableto(ProcessBean)

I think that for parameterized type, raw type must be identical contradicts the above definition.

> ProcessSessionBeanTest testProcessSessionBeanEvent count
> --------------------------------------------------------
>
>                 Key: CDITCK-215
>                 URL: https://issues.jboss.org/browse/CDITCK-215
>             Project: CDI TCK
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 1.0.4.Final
>            Reporter: David Blevins
>
> [Side note maybe there should be versions for 1.0.4.SP1 and  1.0.4.SP2]
> Test: org.jboss.jsr299.tck.tests.extensions.processBean.ProcessSessionBeanTest.testProcessSessionBeanEvent
> Not sure if this is an issue or not, so filling this as a bug and not a challenge.  The test 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++;
>   }
> Specifically the test asserts that observeElephantSessionBean is called and that observeElephantBean is not called.
> Currently we call both because ProcessSessionBean is assignable to ProcessBean and the generics are the same.
> Is there a part of the spec that mandates only the most specific observer method is called?
> The only thing I can find is in 10.4 which says 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.
> Well I guess it's not that clear as it says essentially "this may happen" rather than "this may happen...and when it does the behavior is...[all are invoked || only the most specific is invoked]"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the weld-issues mailing list