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 voidattached(Database database)voidclose()voidcommit()booleangetAutoCommit()StringgetCatalog()StringgetConnectionUserName()intgetDatabaseMajorVersion()intgetDatabaseMinorVersion()StringgetDatabaseProductName()StringgetDatabaseProductVersion()intgetPriority()StringgetURL()booleanisClosed()StringnativeSQL(String sql)voidopen(String url, Driver driverObject, Properties driverProperties)voidrollback()voidsetAutoCommit(boolean autoCommit)MockDatabaseConnectionsetDatabaseMajorVersion(int databaseMajorVersion)MockDatabaseConnectionsetDatabaseMinorVersion(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:
getPriorityin interfacePrioritizedService
-
open
public void open(String url, Driver driverObject, Properties driverProperties) throws DatabaseException
- Specified by:
openin interfaceDatabaseConnection- Throws:
DatabaseException
-
close
public void close() throws DatabaseException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDatabaseConnection- Throws:
DatabaseException
-
commit
public void commit() throws DatabaseException- Specified by:
commitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getAutoCommit
public boolean getAutoCommit() throws DatabaseException- Specified by:
getAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getCatalog
public String getCatalog() throws DatabaseException
- Specified by:
getCatalogin interfaceDatabaseConnection- Throws:
DatabaseException
-
nativeSQL
public String nativeSQL(String sql) throws DatabaseException
- Specified by:
nativeSQLin interfaceDatabaseConnection- Throws:
DatabaseException
-
rollback
public void rollback() throws DatabaseException- Specified by:
rollbackin interfaceDatabaseConnection- Throws:
DatabaseException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws DatabaseException- Specified by:
setAutoCommitin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseProductName
public String getDatabaseProductName() throws DatabaseException
- Specified by:
getDatabaseProductNamein interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseProductVersion
public String getDatabaseProductVersion() throws DatabaseException
- Specified by:
getDatabaseProductVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
getDatabaseMajorVersion
public int getDatabaseMajorVersion() throws DatabaseException- Specified by:
getDatabaseMajorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
setDatabaseMajorVersion
public MockDatabaseConnection setDatabaseMajorVersion(int databaseMajorVersion)
-
getDatabaseMinorVersion
public int getDatabaseMinorVersion() throws DatabaseException- Specified by:
getDatabaseMinorVersionin interfaceDatabaseConnection- Throws:
DatabaseException
-
setDatabaseMinorVersion
public MockDatabaseConnection setDatabaseMinorVersion(int databaseMinorVersion)
-
getURL
public String getURL()
- Specified by:
getURLin interfaceDatabaseConnection
-
getConnectionUserName
public String getConnectionUserName()
- Specified by:
getConnectionUserNamein interfaceDatabaseConnection
-
isClosed
public boolean isClosed() throws DatabaseException- Specified by:
isClosedin interfaceDatabaseConnection- Throws:
DatabaseException
-
attached
public void attached(Database database)
- Specified by:
attachedin interfaceDatabaseConnection
-
-