Class DatabaseWrapper
- java.lang.Object
-
- liquibase.extension.testing.testsystem.wrapper.DatabaseWrapper
-
- Direct Known Subclasses:
DockerDatabaseWrapper
,JdbcDatabaseWrapper
,UnimplementedWrapper
public abstract class DatabaseWrapper extends Object
Wraps the external database used byDatabaseTestSystem
so that HOW the database is interacted with is independent of WHAT we do with that connection. For example, the same setup logic can be applied regardless of whether the wrapped database is accessed viaJdbcDatabaseWrapper
orDockerDatabaseWrapper
.
-
-
Constructor Summary
Constructors Constructor Description DatabaseWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract String
describe()
Describes the configuration of this wrapper.abstract String
getUrl()
abstract String
getUsername()
abstract void
start()
Start the database if possible and ensure it can be connected to.abstract void
stop()
Stop the database if possible.
-
-
-
Method Detail
-
start
public abstract void start() throws Exception
Start the database if possible and ensure it can be connected to. If the database is managed externally, just ensure it can be connected to.- Throws:
Exception
-
stop
public abstract void stop() throws Exception
Stop the database if possible. If the database is managed externally, do not actually stop it.- Throws:
Exception
-
getUsername
public abstract String getUsername()
-
getUrl
public abstract String getUrl()
-
describe
public abstract String describe()
Describes the configuration of this wrapper. Used in outputting to user how this connection is configured.
-
-