Add support CDI in plain OSGi bundles (GLASSFISH-19215)

[GLASSFISH-19346] Adding fighterfish test cases Created: 14/Nov/12  Updated: 10/Dec/12

Status: Open
Project: glassfish
Component/s: OSGi-JavaEE
Affects Version/s: future release
Fix Version/s: None

Type: Sub-task Priority: Critical
Reporter: TangYong Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive GLASSFISH-19215_fighterfishtestcase_20121114.zip     Zip Archive GLASSFISH-19215_fighterfishtestcase_final.zip     Zip Archive GLASSFISH-19215_fighterfishtestcase_multi-interfaces.zip    

 Description   

According to sahoo's test requirements , adding fighterfish test cases. In addition,

1) also needing to add negative test like failing to inject myservice as a regular cdi bean.
2) test cases must separate from stock quote sample, using common test cases liking foo/bar...



 Comments   
Comment by TangYong [ 14/Nov/12 ]

Hi sahoo, siva,

I have created a fighterfish test case for GLASSFISH-19215 and passed on my env successfully.
Please use my 20121114's patch and run the attachment(GLASSFISH-19215_fighterfishtestcase_20121114.zip).

Thanks.
--Tang

Comment by TangYong [ 15/Nov/12 ]

The attachment(GLASSFISH-19215_fighterfishtestcase_final.zip) is the final fighterfish test cases(Totoally two test cases) , and I have added a negative test case for GLASSFISH-19215.

Please try the attachment.

Thanks
--Tang

Comment by Sivakumar Thyagarajan [ 23/Nov/12 ]

The test cases looks good. I will try it out once I have your patch integrated locally into my workspace. The only enhancement I would like to see is that both the tests uses the "contracts" annotations attribute in @OSGiService, but do not use to add any new meaning, and just set the only interface that the Bean is implementing as the "contracts" value. It would be nice if we have another test or just reuse the 2 new test you have added, where the test tries to choose from one interface from a set of interfaces a Bean implements, and then testing to make sure that BarBean is available as an OSGiService only through Bar.class and not through Baz.class

@Publish(contracts =

{Bar.class}

)
public class BarBean implements Bar, Baz{}

In the test Servlet:
@Inject @OSGiService Bar bar; //must succeed
and
@Inject @OSGiService Baz baz; //must fail

Comment by TangYong [ 24/Nov/12 ]

Hi siva,

Thanks your suggestion very much. I have understood your means and I will add test for multi-interface scene.

Tang

Comment by TangYong [ 27/Nov/12 ]

Hi siva,

I have attached a new test case(GLASSFISH-19215_fighterfishtestcase_multi-interfaces.zip) for testing multi interfaces, and please seeing it.

Thanks.
--Tang

Comment by TangYong [ 10/Dec/12 ]

Because osgi-cdi-api will have some changes which are from Siva's suggestions, fighterfish tests will also make some changes. Waiting for final API Release.

Generated at Tue Jul 07 03:49:57 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.