org.apache.directory.server.integ.state
Class StartedNormalState

java.lang.Object
  extended by org.apache.directory.server.integ.state.AbstractState
      extended by org.apache.directory.server.integ.state.StartedNormalState
All Implemented Interfaces:
TestServerState

public class StartedNormalState
extends AbstractState

The state of a running test service which has been used for running integration tests and has been reverted to contain the same content as it did when created and started. It is not really pristine however for all practical purposes of integration testing it appears to be the same as when first started.

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

Field Summary
 
Fields inherited from class org.apache.directory.server.integ.state.AbstractState
context
 
Constructor Summary
StartedNormalState(TestServerContext context)
          Creates a new instance of StartedNormalState.
 
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 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, InheritableServerSettings settings)
          Action where an attempt is made to run a test against the service.
 
Methods inherited from class org.apache.directory.server.integ.state.AbstractState
create, injectLdifs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StartedNormalState

public StartedNormalState(TestServerContext context)
Creates a new instance of StartedNormalState.

Parameters:
context - the test's context
Method Detail

destroy

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

Specified by:
destroy in interface TestServerState
Overrides:
destroy in class AbstractState

cleanup

public 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.

Specified by:
cleanup in interface TestServerState
Overrides:
cleanup in class AbstractState
Throws:
java.io.IOException - on errors while deleting the working directory

startup

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

Specified by:
startup in interface TestServerState
Overrides:
startup in class AbstractState
Throws:
java.lang.Exception - on failures to start the core directory service

shutdown

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

Specified by:
shutdown in interface TestServerState
Overrides:
shutdown in class AbstractState
Throws:
java.lang.Exception - on failures to stop the core directory service

revert

public 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.

Specified by:
revert in interface TestServerState
Overrides:
revert in class AbstractState
Throws:
java.lang.Exception - on failures to revert the state of the core directory service

test

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

Specified by:
test in interface TestServerState
Overrides:
test in class AbstractState
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


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