Class ServerSetupObserver
java.lang.Object
org.jboss.as.arquillian.container.ServerSetupObserver
Observes the
BeforeDeploy, AfterUnDeploy and AfterClass lifecycle events to ensure
setup tasks are executed.- Author:
- Stuart Douglas, James R. Perkins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterTestClass(org.jboss.arquillian.test.spi.event.suite.AfterClass afterClass) Executed after the test class has completed.voidhandleAfterUndeploy(org.jboss.arquillian.container.spi.event.container.AfterUnDeploy afterDeploy, org.jboss.arquillian.container.spi.Container container) Executed after each undeploy for the container.voidhandleBeforeClass(org.jboss.arquillian.test.spi.event.suite.BeforeClass beforeClass) Observed only for state changes.voidhandleBeforeDeployment(org.jboss.arquillian.container.spi.event.container.BeforeDeploy event, org.jboss.arquillian.container.spi.Container container) Executed before deployments to lazily execute theServerSetupTask.
-
Constructor Details
-
ServerSetupObserver
public ServerSetupObserver()
-
-
Method Details
-
handleBeforeClass
public void handleBeforeClass(@Observes org.jboss.arquillian.test.spi.event.suite.BeforeClass beforeClass) Observed only for state changes.- Parameters:
beforeClass- the lifecycle event
-
handleBeforeDeployment
public void handleBeforeDeployment(@Observes org.jboss.arquillian.container.spi.event.container.BeforeDeploy event, org.jboss.arquillian.container.spi.Container container) throws Throwable Executed before deployments to lazily execute theServerSetupTask.This is lazily loaded for manual mode tests. The server may not have been started at the
BeforeClassevent.- Parameters:
event- the lifecycle eventcontainer- the container the event is being invoked on- Throws:
Throwable- if an error occurs processing the event
-
afterTestClass
public void afterTestClass(@Observes org.jboss.arquillian.test.spi.event.suite.AfterClass afterClass) throws Exception Executed after the test class has completed. This ensures that any tear down tasks have been executed if all deployments have been undeployed.- Parameters:
afterClass- the lifecycle event- Throws:
Exception- if an error occurs processing the event
-
handleAfterUndeploy
public void handleAfterUndeploy(@Observes org.jboss.arquillian.container.spi.event.container.AfterUnDeploy afterDeploy, org.jboss.arquillian.container.spi.Container container) throws Exception Executed after each undeploy for the container.- Parameters:
afterDeploy- the lifecycle eventcontainer- the container the event is being invoked on- Throws:
Exception- if an error occurs processing the event
-