dev@glassfish.java.net

Re: How to initialize Habitat with new version of HK2 in unit testing environment

From: Andriy Zhdanov <andriy.zhdanov_at_oracle.com>
Date: Fri, 20 Jul 2012 09:39:41 +0200

Hi Dapeng,

If you refer to HK2 trunk, you may see
http://java.net/projects/hk2/sources/svn/content/trunk/hk2/examples/ctm/src/test/java/org/glassfish/examples/ctm/runme/CTMTest.java?rev=3710

Thank you.

On 7/20/12 9:00 AM, Dapeng Hu wrote:
>
> Hi:
>
> I have a unit testcase which contains the following codes. It has
> passed with the old version of HK2 but always returns null with HK2 v2.0.
>
> habitat.getByType(ApplicationArchivist.class);
>
> Who has an example about how to initialize the Habitat with new HK2 in
> unit testing environment?
>
> Regards
>
> cid:CDF643B8-3803-4A72-AB35-BE2FD51C3CDC
> Dapeng Hu| Senior Techinical Staff | 86-10-61065511
> OracleWeblogicServer Development
> Oracle Building | Zhongguanchun Software Park| Bejing, 100193, P.R.C
>