Class AbstractPostgreSqlJUnit

  • Direct Known Subclasses:
    PostgreSqlExtension, PostgreSqlRule

    public abstract class AbstractPostgreSqlJUnit
    extends java.lang.Object
    Abstract JUnit PostgreSql functionality.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • pullDockerImage

        public static void pullDockerImage​(java.lang.String imageName,
                                           com.github.dockerjava.api.DockerClient client)
                                    throws java.lang.Exception
        Pulls 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.Exception
        Starts PostgreSql.
        Throws:
        java.lang.Exception - If fails to start PostgreSql.
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.lang.Exception
        Obtains a Connection.
        Returns:
        Connection.
        Throws:
        java.lang.Exception - If fails to obtain Connection.
      • stopPostgreSql

        public void stopPostgreSql()
                            throws java.lang.Exception
        Stops PostgreSql.
        Throws:
        java.lang.Exception - If fails to stop PostgreSql.