[ 
https://issues.apache.org/jira/browse/OWB-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul J. Reder updated OWB-367:
------------------------------

    Attachment: unittestIfExistsV2.patch

One thing that seemed odd about this test that may be a result of the way junit 
works or possibly indicates an issue with the way observes with IF_EXISTS are 
handled: Notice that it was enough to simply call getInstance for component4 
(without IF_EXISTS) and it was notified of the event, but for component5 
(identical to 4 but with an added IF_EXISTS) it does not receive the event 
unless I *also* call a method in the class. 

        ComponentWithObserves4 instance = getManager().getInstance(component4);
        ComponentWithObserves5 instanceIE = 
getManager().getInstance(component5);
...
        instanceIE.getUserName();       <<<<<< Should this really be required?

> Add a unit test for IF_EXISTS
> -----------------------------
>
>                 Key: OWB-367
>                 URL: https://issues.apache.org/jira/browse/OWB-367
>             Project: OpenWebBeans
>          Issue Type: Test
>          Components: Events
>    Affects Versions: 1.0.0
>         Environment: All
>            Reporter: Paul J. Reder
>            Assignee: Gurkan Erdogdu
>            Priority: Minor
>             Fix For: 1.0.0
>
>         Attachments: unittestIfExistsV2.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There currently is no unit test to cover IF_EXISTS. The attached patch adds a 
> unit test that verifies three cases: Normal observer without IF_EXISTS; an 
> observer with IF_EXISTS that *is* instanciated; and an observer with 
> IF_EXISTS that is *not* instanciated. The first two observers should receive 
> the event, the last described observer should not.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to