Class ServerSetupObserver

java.lang.Object
org.jboss.as.arquillian.container.ServerSetupObserver

public class ServerSetupObserver extends Object
Observes the BeforeDeploy, AfterUnDeploy and AfterClass lifecycle events to ensure setup tasks are executed.
Author:
Stuart Douglas, James R. Perkins
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterTestClass(org.jboss.arquillian.test.spi.event.suite.AfterClass afterClass)
    Executed after the test class has completed.
    void
    handleAfterUndeploy(org.jboss.arquillian.container.spi.event.container.AfterUnDeploy afterDeploy, org.jboss.arquillian.container.spi.Container container)
    Executed after each undeploy for the container.
    void
    handleBeforeClass(org.jboss.arquillian.test.spi.event.suite.BeforeClass beforeClass)
    Observed only for state changes.
    void
    handleBeforeDeployment(org.jboss.arquillian.container.spi.event.container.BeforeDeploy event, org.jboss.arquillian.container.spi.Container container)
    Executed before deployments to lazily execute the ServerSetupTask.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the ServerSetupTask.

      This is lazily loaded for manual mode tests. The server may not have been started at the BeforeClass event.

      Parameters:
      event - the lifecycle event
      container - 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 event
      container - the container the event is being invoked on
      Throws:
      Exception - if an error occurs processing the event