Class AbstractPostgreSqlJUnit
- java.lang.Object
-
- net.officefloor.jdbc.postgresql.test.AbstractPostgreSqlJUnit
-
- Direct Known Subclasses:
PostgreSqlExtension,PostgreSqlRule
public abstract class AbstractPostgreSqlJUnit extends java.lang.ObjectAbstract JUnit PostgreSql functionality.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractPostgreSqlJUnit.ConfigurationConfiguration of the PostgreSql database.
-
Constructor Summary
Constructors Constructor Description AbstractPostgreSqlJUnit()Instantiate with defaultAbstractPostgreSqlJUnit.Configuration.AbstractPostgreSqlJUnit(AbstractPostgreSqlJUnit.Configuration configuration)Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.ConnectiongetConnection()Obtains aConnection.static voidpullDockerImage(java.lang.String imageName, com.github.dockerjava.api.DockerClient client)Pulls the docker image.voidstartPostgreSql()Starts PostgreSql.voidstopPostgreSql()Stops PostgreSql.
-
-
-
Constructor Detail
-
AbstractPostgreSqlJUnit
public AbstractPostgreSqlJUnit()
Instantiate with defaultAbstractPostgreSqlJUnit.Configuration.
-
AbstractPostgreSqlJUnit
public AbstractPostgreSqlJUnit(AbstractPostgreSqlJUnit.Configuration configuration)
Instantiate.- Parameters:
configuration-AbstractPostgreSqlJUnit.Configuration.
-
-
Method Detail
-
pullDockerImage
public static void pullDockerImage(java.lang.String imageName, com.github.dockerjava.api.DockerClient client) throws java.lang.ExceptionPulls the docker image.- Parameters:
imageName- Docker image name.client-DockerClient.- Throws:
java.lang.Exception- If fails to pull image.
-
startPostgreSql
public void startPostgreSql() throws java.lang.ExceptionStarts PostgreSql.- Throws:
java.lang.Exception- If fails to start PostgreSql.
-
getConnection
public java.sql.Connection getConnection() throws java.lang.ExceptionObtains aConnection.- Returns:
Connection.- Throws:
java.lang.Exception- If fails to obtainConnection.
-
stopPostgreSql
public void stopPostgreSql() throws java.lang.ExceptionStops PostgreSql.- Throws:
java.lang.Exception- If fails to stop PostgreSql.
-
-