org.apache.directory.server.core.integ.state
Interface TestServiceState

All Known Implementing Classes:
AbstractState, NonExistentState, StartedNormalState, StartedPristineState

public interface TestServiceState

The interface representing a state in the lifecycle of a service during integration testing.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 void cleanup()
          Action where an attempt is made to erase the contents of the working directory used by the service for various files including partition database files.
 void create(InheritableSettings settings)
          Action where an attempt is made to create the service.
 void destroy()
          Action where an attempt is made to destroy the service.
 void revert()
          Action where an attempt is made to revert the service to it's initial start up state by using a previous snapshot.
 void shutdown()
          Action where an attempt is made to shutdown the service.
 void startup()
          Action where an attempt is made to start up the service.
 void test(org.junit.internal.runners.TestClass testClass, org.junit.internal.runners.TestMethod testMethod, org.junit.runner.notification.RunNotifier notifier, InheritableSettings settings)
          Action where an attempt is made to run a test against the service.
 

Method Detail

create

void create(InheritableSettings settings)
            throws javax.naming.NamingException
Action where an attempt is made to create the service. Service creation in this system is the combined instantiation and configuration which takes place when the factory is used to get a new instance of the service.

Parameters:
settings - The inherited settings
Throws:
javax.naming.NamingException - if we can't create the service

destroy

void destroy()
Action where an attempt is made to destroy the service. This entails nulling out reference to it and triggering garbage collection.


cleanup

void cleanup()
             throws java.io.IOException
Action where an attempt is made to erase the contents of the working directory used by the service for various files including partition database files.

Throws:
java.io.IOException - on errors while deleting the working directory

startup

void startup()
             throws java.lang.Exception
Action where an attempt is made to start up the service.

Throws:
java.lang.Exception - on failures to start the core directory service

shutdown

void shutdown()
              throws java.lang.Exception
Action where an attempt is made to shutdown the service.

Throws:
java.lang.Exception - on failures to stop the core directory service

test

void test(org.junit.internal.runners.TestClass testClass,
          org.junit.internal.runners.TestMethod testMethod,
          org.junit.runner.notification.RunNotifier notifier,
          InheritableSettings settings)
Action where an attempt is made to run a test against the service. All annotations should have already been processed for InheritableSettings yet they and others can be processed since we have access to the method annotations below

Parameters:
testClass - the class whose test method is to be run
testMethod - the test method which is to be run
notifier - a notifier to report failures to
settings - the inherited settings and annotations associated with the test method

revert

void revert()
            throws java.lang.Exception
Action where an attempt is made to revert the service to it's initial start up state by using a previous snapshot.

Throws:
java.lang.Exception - on failures to revert the state of the core directory service


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.