Package liquibase.database
Class MockDatabaseConnection
- java.lang.Object
-
- liquibase.database.MockDatabaseConnection
-
- All Implemented Interfaces:
AutoCloseable
,DatabaseConnection
,PrioritizedService
public class MockDatabaseConnection extends Object implements DatabaseConnection
-
-
Field Summary
-
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description MockDatabaseConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attached(Database database)
void
close()
void
commit()
boolean
getAutoCommit()
String
getCatalog()
String
getConnectionUserName()
int
getDatabaseMajorVersion()
int
getDatabaseMinorVersion()
String
getDatabaseProductName()
String
getDatabaseProductVersion()
int
getPriority()
String
getURL()
boolean
isClosed()
String
nativeSQL(String sql)
void
open(String url, Driver driverObject, Properties driverProperties)
void
rollback()
void
setAutoCommit(boolean autoCommit)
MockDatabaseConnection
setDatabaseMajorVersion(int databaseMajorVersion)
MockDatabaseConnection
setDatabaseMinorVersion(int databaseMinorVersion)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.database.DatabaseConnection
supports
-
-
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriority
in interfacePrioritizedService
-
open
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException
- Specified by:
open
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
close
public void close() throws DatabaseException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
commit
public void commit() throws DatabaseException
- Specified by:
commit
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getAutoCommit
public boolean getAutoCommit() throws DatabaseException
- Specified by:
getAutoCommit
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getCatalog
public String getCatalog() throws DatabaseException
- Specified by:
getCatalog
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
nativeSQL
public String nativeSQL(String sql) throws DatabaseException
- Specified by:
nativeSQL
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
rollback
public void rollback() throws DatabaseException
- Specified by:
rollback
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws DatabaseException
- Specified by:
setAutoCommit
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseProductName
public String getDatabaseProductName() throws DatabaseException
- Specified by:
getDatabaseProductName
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseProductVersion
public String getDatabaseProductVersion() throws DatabaseException
- Specified by:
getDatabaseProductVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws DatabaseException
- Specified by:
getDatabaseMajorVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
setDatabaseMajorVersion
public MockDatabaseConnection setDatabaseMajorVersion(int databaseMajorVersion)
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws DatabaseException
- Specified by:
getDatabaseMinorVersion
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
setDatabaseMinorVersion
public MockDatabaseConnection setDatabaseMinorVersion(int databaseMinorVersion)
-
getURL
public String getURL()
- Specified by:
getURL
in interfaceDatabaseConnection
-
getConnectionUserName
public String getConnectionUserName()
- Specified by:
getConnectionUserName
in interfaceDatabaseConnection
-
isClosed
public boolean isClosed() throws DatabaseException
- Specified by:
isClosed
in interfaceDatabaseConnection
- Throws:
DatabaseException
-
attached
public void attached(Database database)
- Specified by:
attached
in interfaceDatabaseConnection
-
-