Class BaseDatabaseTestCase

    • Constructor Detail

      • BaseDatabaseTestCase

        public BaseDatabaseTestCase()
      • BaseDatabaseTestCase

        public BaseDatabaseTestCase​(String a)
    • Method Detail

      • setUpClassStatic

        @BeforeClass
        public void setUpClassStatic()
                              throws Exception
        Throws:
        Exception
      • ensureCleanTable

        protected void ensureCleanTable​(String... strings)
      • ensureCleanTable

        protected void ensureCleanTable​(@NotNull
                                        TableDef table)
      • ensureCleanSchema

        protected void ensureCleanSchema​(@NotNull
                                         SchemaDef schema)
      • ensureNoTables

        protected void ensureNoTables​(String... tableNames)
      • withDBF

        protected <T> T withDBF​(@NotNull
                                DBAction<T> action,
                                boolean commitOnSuccess)
      • withDBF

        protected void withDBF​(@NotNull
                               DBActionNoResults action,
                               boolean commitOnSuccess)
      • cleanupTables

        protected static void cleanupTables​(@NotNull
                                            String... tableNames)
        Deletes all rows from the specified table.
        Parameters:
        tableName - table name.
      • cleanupTables

        protected static void cleanupTables​(DBFunctions dbf,
                                            String... tableNames)
        Deletes all rows from the specified tables.
        Parameters:
        dbf - database connectiomn and functions.
        tableNames - table names.
      • cleanupTable

        protected static void cleanupTable​(DBFunctions dbf,
                                           String tableName)
        Deletes all rows from the specified table.
        Parameters:
        dbf - database connectiomn and functions.
        tableName - table name.
      • dumpTables

        protected void dumpTables​(@NotNull
                                  Collection<String> tableNames)
      • dumpTables

        protected void dumpTables​(@NotNull
                                  String... tableNames)
      • dumpTable

        protected void dumpTable​(String tableName)
        Dumps the specified table to a standard output, using the current connection.
        Parameters:
        tableName - name of table to dump.
        Throws:
        SQLException - when something goes wrong.
      • dumpTable

        protected static void dumpTable​(String tableName,
                                        Connection conn)
                                 throws SQLException
        Dumps the specified table to a standard output, using the specified connection.
        Parameters:
        tableName - name of table to dump.
        conn - db connection.
        Throws:
        SQLException - when something goes wrong.
      • ensureSingleRowTable

        protected void ensureSingleRowTable()
      • countTableRows

        protected int countTableRows​(@NotNull
                                     String tableName,
                                     @Nullable
                                     String condition,
                                     Object... params)
      • assertNoTableRows

        protected void assertNoTableRows​(@NotNull
                                         String tableName,
                                         @Nullable
                                         String condition,
                                         Object... params)
      • createEmptyServerPath

        protected ServerPaths createEmptyServerPath()
      • provideWithCurrentDatabaseType

        @DataProvider
        public static DatabaseType[][] provideWithCurrentDatabaseType()
      • provideDatabaseTypeNotHSQL

        @DataProvider
        public static DatabaseType[][] provideDatabaseTypeNotHSQL()
      • provideDatabaseTypeNotMySQL

        @DataProvider
        public static DatabaseType[][] provideDatabaseTypeNotMySQL()
      • provideDatabaseTypeMySQLOnly

        @DataProvider
        public static DatabaseType[][] provideDatabaseTypeMySQLOnly()
      • provideDatabaseMsOnly

        @DataProvider
        public static DatabaseType[][] provideDatabaseMsOnly()
      • provideDatabaseHsql2Only

        @DataProvider
        public static DatabaseType[][] provideDatabaseHsql2Only()
      • provideDatabaseTypeSupportI18n

        @DataProvider
        public static DatabaseType[][] provideDatabaseTypeSupportI18n()
      • populateTablesWithSimpleData

        protected static void populateTablesWithSimpleData()