|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.fighterfish.test.util.TestContext
public class TestContext
A TestContext is a facade through which a test interacts with underlying OSGi or Java EE platform.
It provides functionality like installing/uninstalling bundles, configuring Java EE resources like
JDBC data sources, JMS destinations, etc. Each test method is accompanied by a single TestContext object.
A TestContext object's life cycle is scoped to a test method for this reason. Each test method must create a
TestContext by calling the factory method create(BundleContext) at the beginning of the test method and
destroy it by calling destroy() at the end of the test method. When a test context is destroyed, all changes
done so far will be rolled back. This includes any bundles deployed. any domain configuration made, etc.
| Method Summary | |
|---|---|
void |
configureEmbeddedDerby()
|
static TestContext |
create(org.osgi.framework.BundleContext ctx)
|
void |
createJmsCF(String cfName)
|
void |
createJmsTopic(String topicName)
|
EjbBundle |
deployEjbBundle(org.osgi.framework.Bundle bundle,
String[] services)
Deploy the given EJB OSGi bundle. |
EntityBundle |
deployEntityBundle(org.osgi.framework.Bundle bundle)
Deploy the given JPA Entities bundle. |
WebAppBundle |
deployWebAppBundle(org.osgi.framework.Bundle bundle)
Deploy the given OSGi Web Application Bundle. |
void |
destroy()
|
org.osgi.framework.BundleContext |
getBundleContext()
|
org.glassfish.embeddable.GlassFish |
getGlassFish()
|
org.osgi.framework.Bundle |
installTestBundle(String location)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TestContext create(org.osgi.framework.BundleContext ctx)
throws org.glassfish.embeddable.GlassFishException,
InterruptedException
org.glassfish.embeddable.GlassFishException
InterruptedException
public void destroy()
throws org.osgi.framework.BundleException,
org.glassfish.embeddable.GlassFishException
org.osgi.framework.BundleException
org.glassfish.embeddable.GlassFishException
public WebAppBundle deployWebAppBundle(org.osgi.framework.Bundle bundle)
throws org.osgi.framework.BundleException,
InterruptedException
bundle -
org.osgi.framework.BundleException
InterruptedException
public EntityBundle deployEntityBundle(org.osgi.framework.Bundle bundle)
throws org.osgi.framework.BundleException,
InterruptedException
bundle - Entity bundle to be deployed
org.osgi.framework.BundleException
InterruptedException
TimeoutException
public EjbBundle deployEjbBundle(org.osgi.framework.Bundle bundle,
String[] services)
throws org.osgi.framework.BundleException,
InterruptedException
bundle - EJB Bundle to be deployedservices - Services that are expected to be made available by this EJB bundle if deployment is successful.
org.osgi.framework.BundleException
InterruptedException
TimeoutException
public org.glassfish.embeddable.GlassFish getGlassFish()
throws org.glassfish.embeddable.GlassFishException,
InterruptedException
org.glassfish.embeddable.GlassFishException
InterruptedException
public void configureEmbeddedDerby()
throws org.glassfish.embeddable.GlassFishException,
InterruptedException
org.glassfish.embeddable.GlassFishException
InterruptedExceptionpublic org.osgi.framework.BundleContext getBundleContext()
public org.osgi.framework.Bundle installTestBundle(String location)
throws org.osgi.framework.BundleException
org.osgi.framework.BundleException
public void createJmsCF(String cfName)
throws org.glassfish.embeddable.GlassFishException,
InterruptedException
org.glassfish.embeddable.GlassFishException
InterruptedException
public void createJmsTopic(String topicName)
throws org.glassfish.embeddable.GlassFishException,
InterruptedException
org.glassfish.embeddable.GlassFishException
InterruptedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||