Class 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 Detail

      • ServerSetupObserver

        public ServerSetupObserver()
    • Method Detail

      • 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