|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.database.DatabaseUnitils
public class DatabaseUnitils
Class providing access to the functionality of the database module using static methods. Meant to be used directly in unit tests.
| Constructor Summary | |
|---|---|
DatabaseUnitils()
|
|
| Method Summary | |
|---|---|
static void |
cleanSchemas()
Cleans all configured schema's. |
static void |
cleanSchemas(String databaseName)
Cleans all configured schema's. |
static void |
clearSchemas()
Clears all configured schema's. |
static void |
clearSchemas(String databaseName)
Clears all configured schema's. |
static void |
commitTransaction()
Commits the current unitils transaction |
static void |
disableConstraints()
Disables all foreign key and not-null constraints on the configured schema's. |
static void |
disableConstraints(String databaseName)
Disables all foreign key and not-null constraints on the configured schema's. |
static void |
flushDatabaseUpdates()
Flushes all pending updates to the database. |
static void |
generateDatasetDefinition()
Generates a definition file that defines the structure of dataset's, i.e. a XSD of DTD that describes the structure of the database. |
static void |
generateDatasetDefinition(String databaseName)
Generates a definition file that defines the structure of dataset's, i.e. a XSD of DTD that describes the structure of the database. |
static DataSource |
getDataSource()
Returns the DataSource that connects to the test database |
static DataSource |
getDataSource(String databaseName)
Returns the DataSource that connects to the test database |
static void |
resetDatabaseState()
Updates the database version to the current version, without issuing any other updates to the database. |
static void |
resetDatabaseState(String databaseName)
Updates the database version to the current version, without issuing any other updates to the database. |
static void |
rollbackTransaction()
Performs a rollback of the current unitils transaction |
static void |
startTransaction()
Starts a new transaction on the transaction manager configured in unitils |
static void |
updateDatabase()
Determines whether the test database is outdated and, if that is the case, updates the database with the latest changes. |
static void |
updateDatabase(String databaseName)
Determines whether the test database is outdated and, if that is the case, updates the database with the latest changes. |
static void |
updateSequences()
Updates all sequences that have a value below a certain configurable treshold to become equal to this treshold |
static void |
updateSequences(String databaseName)
Updates all sequences that have a value below a certain configurable treshold to become equal to this treshold |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatabaseUnitils()
| Method Detail |
|---|
public static DataSource getDataSource(String databaseName)
public static DataSource getDataSource()
public static void flushDatabaseUpdates()
public static void startTransaction()
public static void commitTransaction()
public static void rollbackTransaction()
public static void updateDatabase()
DBMaintainer for more information.
public static void updateDatabase(String databaseName)
DBMaintainer for more information.
public static void resetDatabaseState()
public static void resetDatabaseState(String databaseName)
public static void clearSchemas()
public static void clearSchemas(String databaseName)
public static void cleanSchemas()
public static void cleanSchemas(String databaseName)
public static void disableConstraints()
public static void disableConstraints(String databaseName)
public static void updateSequences()
public static void updateSequences(String databaseName)
public static void generateDatasetDefinition()
public static void generateDatasetDefinition(String databaseName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||