Class TestDatabaseProvider

java.lang.Object
org.dalesbred.junit.TestDatabaseProvider

public final class TestDatabaseProvider extends Object

Helper methods for creating databases using a properties-file in classpath.

The properties should have the following keys:

<table jdbc.urlrequiredJDBC url of the database to connect jdbc.loginoptionallogin for the database jdbc.passwordoptionalpassword for the database
  • Method Details

    • databaseForProperties

      @NotNull public static @NotNull org.dalesbred.Database databaseForProperties(@NotNull @NotNull String propertiesPath)
      Loads database with given properties.
      Throws:
      org.junit.internal.AssumptionViolatedException - if properties were not found
    • databaseForProperties

      @NotNull public static @NotNull org.dalesbred.Database databaseForProperties(@NotNull @NotNull String propertiesPath, @NotNull @NotNull org.dalesbred.dialect.Dialect dialect)
      Loads database with given properties, using specified dialect.
      Throws:
      org.junit.internal.AssumptionViolatedException - if properties were not found