|
|||||||||
| 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(Class) 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(java.lang.Class testClass)
|
void |
createJmsCF(java.lang.String cfName)
|
void |
createJmsTopic(java.lang.String topicName)
|
EjbBundle |
deployEjbBundle(org.osgi.framework.Bundle bundle,
java.lang.String[] services)
Deploy the given EJB OSGi bundle. |
EjbBundle |
deployEjbBundle(java.lang.String location,
java.lang.String[] services)
|
EntityBundle |
deployEntityBundle(org.osgi.framework.Bundle bundle)
Deploy the given JPA Entities bundle. |
EntityBundle |
deployEntityBundle(java.lang.String location)
|
WebAppBundle |
deployWebAppBundle(org.osgi.framework.Bundle bundle)
Deploy the given OSGi Web Application Bundle. |
WebAppBundle |
deployWebAppBundle(java.lang.String location)
|
void |
destroy()
|
org.osgi.framework.BundleContext |
getBundleContext()
|
org.glassfish.embeddable.GlassFish |
getGlassFish()
|
org.osgi.framework.Bundle |
installBundle(java.lang.String location)
Install an OSGi bundle by reading its content from a given location URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TestContext create(java.lang.Class testClass)
throws org.glassfish.embeddable.GlassFishException,
java.lang.InterruptedException
org.glassfish.embeddable.GlassFishException
java.lang.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,
java.lang.InterruptedException
bundle -
org.osgi.framework.BundleException
java.lang.InterruptedException
public WebAppBundle deployWebAppBundle(java.lang.String location)
throws org.osgi.framework.BundleException,
java.lang.InterruptedException
org.osgi.framework.BundleException
java.lang.InterruptedException
public EntityBundle deployEntityBundle(org.osgi.framework.Bundle bundle)
throws org.osgi.framework.BundleException,
java.lang.InterruptedException
bundle - Entity bundle to be deployed
org.osgi.framework.BundleException
java.lang.InterruptedException
TimeoutException
public EntityBundle deployEntityBundle(java.lang.String location)
throws org.osgi.framework.BundleException,
java.lang.InterruptedException
org.osgi.framework.BundleException
java.lang.InterruptedException
public EjbBundle deployEjbBundle(org.osgi.framework.Bundle bundle,
java.lang.String[] services)
throws org.osgi.framework.BundleException,
java.lang.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
java.lang.InterruptedException
TimeoutException
public EjbBundle deployEjbBundle(java.lang.String location,
java.lang.String[] services)
throws org.osgi.framework.BundleException,
java.lang.InterruptedException
org.osgi.framework.BundleException
java.lang.InterruptedException
public org.glassfish.embeddable.GlassFish getGlassFish()
throws org.glassfish.embeddable.GlassFishException,
java.lang.InterruptedException
org.glassfish.embeddable.GlassFishException
java.lang.InterruptedException
public void configureEmbeddedDerby()
throws org.glassfish.embeddable.GlassFishException,
java.lang.InterruptedException
org.glassfish.embeddable.GlassFishException
java.lang.InterruptedExceptionpublic org.osgi.framework.BundleContext getBundleContext()
public org.osgi.framework.Bundle installBundle(java.lang.String location)
throws org.osgi.framework.BundleException
location - a URI string from which the bundle content will be read
org.osgi.framework.BundleException
public void createJmsCF(java.lang.String cfName)
throws org.glassfish.embeddable.GlassFishException,
java.lang.InterruptedException
org.glassfish.embeddable.GlassFishException
java.lang.InterruptedException
public void createJmsTopic(java.lang.String topicName)
throws org.glassfish.embeddable.GlassFishException,
java.lang.InterruptedException
org.glassfish.embeddable.GlassFishException
java.lang.InterruptedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||