Class TestDatabaseProvider


  • public final class TestDatabaseProvider
    extends java.lang.Object

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

    The properties should have the following keys:

    jdbc.urlrequiredJDBC url of the database to connect
    jdbc.loginoptionallogin for the database
    jdbc.passwordoptionalpassword for the database
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull org.dalesbred.Database databaseForProperties​(@NotNull java.lang.String propertiesPath)
      Loads database with given properties.
      static @NotNull org.dalesbred.Database databaseForProperties​(@NotNull java.lang.String propertiesPath, @NotNull org.dalesbred.dialect.Dialect dialect)
      Loads database with given properties, using specified dialect.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • databaseForProperties

        @NotNull
        public static @NotNull org.dalesbred.Database databaseForProperties​(@NotNull
                                                                            @NotNull java.lang.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 java.lang.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