|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.fighterfish.test.util.WebAppBundle
public class WebAppBundle
This class is used by tests to deploy WABs. Since a WAB deployment happens asynchronously when a WAB is activated, for a test case to know whether the deployment is successful or not is not as simple as checking if wab.start() returns succesfully or not. This is where this class is helpful. It listens to events raised by the OSGi Web Container as required by the OSGi Web Application spec and depending on the events, returns success or failure when a WAB is deployed. It also uses a timeout mechanism if the deployment does not happen in a specified amount of time.
| Constructor Summary | |
|---|---|
WebAppBundle(org.osgi.framework.BundleContext context,
org.osgi.framework.Bundle b)
A handle to the web application bundle being deployed. |
|
| Method Summary | |
|---|---|
javax.servlet.ServletContext |
deploy(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Deploy the given OSGi Web Application Bundle. |
org.osgi.framework.Bundle |
getBundle()
|
java.lang.String |
getHttpGetResponse(java.lang.String relativePath)
|
java.lang.String |
getHttpPostResponse(java.lang.String relativePath)
|
javax.servlet.ServletContext |
getServletContext()
|
void |
undeploy()
Undeploy the OSGi Web Application Bundle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebAppBundle(org.osgi.framework.BundleContext context,
org.osgi.framework.Bundle b)
context - BundleContext of test used for various OSGi operation. This is not the context of the WAB.b - Web App Bundle| Method Detail |
|---|
public javax.servlet.ServletContext deploy(long timeout,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException,
org.osgi.framework.BundleException,
TimeoutException
timeout - Amount of time it will wait for the deployment to happen before failingtimeUnit -
java.lang.InterruptedException
org.osgi.framework.BundleException
TimeoutException - if deployment takes longer than the specified timeout value.
public void undeploy()
throws org.osgi.framework.BundleException
org.osgi.framework.BundleExceptionpublic javax.servlet.ServletContext getServletContext()
public org.osgi.framework.Bundle getBundle()
public java.lang.String getHttpPostResponse(java.lang.String relativePath)
throws java.io.IOException
java.io.IOException
public java.lang.String getHttpGetResponse(java.lang.String relativePath)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||