|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wamblee.support.persistence.DatabaseBuilder
public class DatabaseBuilder
DatabaseBuilder is used from unit test to obtain a reference to a database
from unit test. This database is either an inmemory database or represents an
external database. Purpose of this utility is to make test code independent
of the particular database used and specifically to be able to run database
tests without any configuration at all (using an inmemory database).
The type of database to use can be overridden by specifying either a system
property or an environment variable (DB_CAPABILITIES_PROP) that
contains the comma-separated capabilities of the database. Each database type
provides its own capabilities (see DatabaseProvider implementations}.
There are currently two database types available:
DerbyDatabaseProvider. This
is the default.DatabaseBuilder uses the ServiceLoader mechanism to
find implementations of DatabaseProvider on the classpath. In the
getDatabase(String...) method a number of capabilities are passed.
The database providers are then searched in (arbitrary) order and the first
one that has all required capabilities is returned.
getSupportedDatabases() gives a list of all available databases.
| Method Summary | |
|---|---|
static Database |
getDatabase(java.lang.String... aCapabilities)
Gets the first database that has all required capabilities. |
static java.util.List<DatabaseDescription> |
getSupportedDatabases()
Gets a list of available databases. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Database getDatabase(java.lang.String... aCapabilities)
aCapabilities - Capabilities.
public static java.util.List<DatabaseDescription> getSupportedDatabases()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||