org.unitils.database.util
Enum TransactionMode

java.lang.Object
  extended by java.lang.Enum<TransactionMode>
      extended by org.unitils.database.util.TransactionMode
All Implemented Interfaces:
Serializable, Comparable<TransactionMode>

public enum TransactionMode
extends Enum<TransactionMode>

Defining the available transaction modes for a test. Defines whether a test must be run in a transaction and, if yes, what is the commit/rollback behavior.

Author:
Filip Neven, Tim Ducheyne

Enum Constant Summary
COMMIT
          Value indicating that the test should be executed in a transaction, and that this transaction must be committed at the end of the test.
DEFAULT
          Value indicating that the default behavior is defined by the unitils property DatabaseModule.Transactional.value.default is in use.
DISABLED
          Value indicating that transactions should be disabled, i.e. the test should not be run in a transaction
ROLLBACK
          Value indicating that the test should be executed in a transaction, and that this transaction must be rollbacked at the end of the test.
 
Method Summary
static TransactionMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TransactionMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DISABLED

public static final TransactionMode DISABLED
Value indicating that transactions should be disabled, i.e. the test should not be run in a transaction


COMMIT

public static final TransactionMode COMMIT
Value indicating that the test should be executed in a transaction, and that this transaction must be committed at the end of the test.


ROLLBACK

public static final TransactionMode ROLLBACK
Value indicating that the test should be executed in a transaction, and that this transaction must be rollbacked at the end of the test.


DEFAULT

public static final TransactionMode DEFAULT
Value indicating that the default behavior is defined by the unitils property DatabaseModule.Transactional.value.default is in use.

Method Detail

values

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

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

valueOf

public static TransactionMode valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2011. All Rights Reserved.