users@glassfish.java.net

Re: Two embedded glassfish domains

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Mon, 19 Sep 2011 10:56:13 +0530

Can't you use shutdown() method in GFR instead of nullifying the
reference by a brute force method like reflection?

Secondly, why can't you hold the reference to GFR in a static field of
one of your classes that's loaded only once by junit?

Sahoo
On Sunday 18 September 2011 06:37 PM, forums_at_java.net wrote:
> You are absolutely right, you need only a reference to
> GlassFishRuntime to
> start a domain. This is not a problem when you have a single test
> class, or
> several test classes groupped in a single junit test suite (test suite
> can
> hold static reference to gfruntime). But how to pass this reference
> between
> testsuites? I used reflection to nullify GlassFishRuntime reference and
> bootstrap the runtime once again. I found also some problems when one
> domain
> is started/stopped and then the second one is started then. Some
> operations
> simply does not work in that domain