Class TestDatabaseProvider

java.lang.Object
io.metaloom.test.container.provider.client.TestDatabaseProvider

public class TestDatabaseProvider extends Object
  • Constructor Details

    • TestDatabaseProvider

      public TestDatabaseProvider()
  • Method Details

    • client

      public static ProviderClient client(String host, int port)
      Return the REST client for the given host and port.
      Parameters:
      host -
      port -
      Returns:
    • client

      public static ProviderClient client() throws IOException
      Return the REST client which can be used to communicate with the provider server that manages the database pooling.
      Returns:
      Throws:
      IOException
    • config

      public static ProviderConfig config()
      Locate the config which was written by the testdatabase-provider-plugin
      Returns:
    • createPool

      public static DatabasePoolResponse createPool(String poolName, String templateDatabaseName) throws Exception
      Create a new testdatabase pool
      Parameters:
      poolName -
      templateDatabaseName -
      Returns:
      Throws:
      Exception
    • createPostgreSQLDatabase

      public static void createPostgreSQLDatabase(String name) throws SQLException
      Create a new empty database which can be used to setup a new pool.
      Parameters:
      name -
      Throws:
      SQLException
    • dropCreatePostgreSQLDatabase

      public static void dropCreatePostgreSQLDatabase(String name) throws SQLException
      Drop and create create the database with the given name.
      Parameters:
      name -
      Throws:
      SQLException