org.apache.directory.server.core.integ
Enum SetupMode

java.lang.Object
  extended by java.lang.Enum<SetupMode>
      extended by org.apache.directory.server.core.integ.SetupMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SetupMode>

public enum SetupMode
extends java.lang.Enum<SetupMode>

Different modes of conducting core tests.

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

Enum Constant Summary
CUMULATIVE
          If a service is running it is used as is.
NOSERVICE
          Does nothing at all.
PRISTINE
          If a service is running this mode will shutdown the service, destroy it's working directory, null it out and start all over again with a new service object to start it up fresh.
RESTART
          If a service is running this mode will shutdown the service, WITHOUT destroying it's working directory, so changes made in tests are or should be persistant.
ROLLBACK
          If a service is running this mode will NOT shutdown the service, instead the service's state will be reverted to it's previous state before the last test which operated on it.
 
Field Summary
static int CUMULATIVE_ORDINAL
           
 java.lang.String description
           
static int NOSERVICE_ORDINAL
           
 int ordinal
           
static int PRISTINE_ORDINAL
           
static int RESTART_ORDINAL
           
static int ROLLBACK_ORDINAL
           
 
Method Summary
 boolean isStartedDirtyTestable()
           
static SetupMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SetupMode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PRISTINE

public static final SetupMode PRISTINE
If a service is running this mode will shutdown the service, destroy it's working directory, null it out and start all over again with a new service object to start it up fresh. If no service is running, yet a valid handle to a stopped service exists, this handle is used to destroy the working directory then the handle is nulled out. Whether or not a valid service exists a new one is created, and started up.


RESTART

public static final SetupMode RESTART
If a service is running this mode will shutdown the service, WITHOUT destroying it's working directory, so changes made in tests are or should be persistant. The same service object is restarted without creating a new one. If the service exists yet is found to have been shutdown it is restarted. If no service is available, one is created and started up.


ROLLBACK

public static final SetupMode ROLLBACK
If a service is running this mode will NOT shutdown the service, instead the service's state will be reverted to it's previous state before the last test which operated on it. So changes are not persisted across tests. If the service exists yet has been shutdown the working directory is cleaned out and the service is started up. We must destroy working directories since reverts are not possible across shutdowns at this point in time (change log is not persistent).


CUMULATIVE

public static final SetupMode CUMULATIVE
If a service is running it is used as is. Changes across tests have no isolation. If the service has been stopped it is simply restarted. If the service does not exists it is created then started. There is no attempt to destroy existing working directories if any at all exist.


NOSERVICE

public static final SetupMode NOSERVICE
Does nothing at all. Does not care if service is running or if it exists. This is the default. Really useful with suites which you may not want to do anything with. Otherwise for all other modes a suite will start up a server before all runs and shut it down after all runs.

Field Detail

PRISTINE_ORDINAL

public static final int PRISTINE_ORDINAL
See Also:
Constant Field Values

RESTART_ORDINAL

public static final int RESTART_ORDINAL
See Also:
Constant Field Values

ROLLBACK_ORDINAL

public static final int ROLLBACK_ORDINAL
See Also:
Constant Field Values

CUMULATIVE_ORDINAL

public static final int CUMULATIVE_ORDINAL
See Also:
Constant Field Values

NOSERVICE_ORDINAL

public static final int NOSERVICE_ORDINAL
See Also:
Constant Field Values

ordinal

public final int ordinal

description

public final java.lang.String description
Method Detail

values

public static final SetupMode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SetupMode c : SetupMode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SetupMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

isStartedDirtyTestable

public boolean isStartedDirtyTestable()


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