Class AbstractPostgreSqlJUnit
- java.lang.Object
-
- net.officefloor.jdbc.postgresql.test.AbstractPostgreSqlJUnit
-
- Direct Known Subclasses:
PostgreSqlExtension
,PostgreSqlRule
public abstract class AbstractPostgreSqlJUnit extends java.lang.Object
Abstract JUnit PostgreSql functionality.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractPostgreSqlJUnit.Configuration
Configuration of the PostgreSql database.
-
Constructor Summary
Constructors Constructor Description AbstractPostgreSqlJUnit()
Instantiate with defaultAbstractPostgreSqlJUnit.Configuration
.AbstractPostgreSqlJUnit(AbstractPostgreSqlJUnit.Configuration configuration)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.Connection
getConnection()
Obtains aConnection
.void
startPostgreSql()
Starts PostgreSql.void
stopPostgreSql()
Stops PostgreSql.
-
-
-
Constructor Detail
-
AbstractPostgreSqlJUnit
public AbstractPostgreSqlJUnit()
Instantiate with defaultAbstractPostgreSqlJUnit.Configuration
.
-
AbstractPostgreSqlJUnit
public AbstractPostgreSqlJUnit(AbstractPostgreSqlJUnit.Configuration configuration)
Instantiate.- Parameters:
configuration
-AbstractPostgreSqlJUnit.Configuration
.
-
-
Method Detail
-
startPostgreSql
public void startPostgreSql() throws java.lang.Exception
Starts PostgreSql.- Throws:
java.lang.Exception
- If fails to start PostgreSql.
-
getConnection
public java.sql.Connection getConnection() throws java.lang.Exception
Obtains aConnection
.- Returns:
Connection
.- Throws:
java.lang.Exception
- If fails to obtainConnection
.
-
stopPostgreSql
public void stopPostgreSql() throws java.lang.Exception
Stops PostgreSql.- Throws:
java.lang.Exception
- If fails to stop PostgreSql.
-
-