Class TestHelper

java.lang.Object
io.debezium.connector.db2.util.TestHelper

public class TestHelper extends Object
Author:
Horia Chiorean (hchiorea@redhat.com), Luis Garcés-Erice
  • Field Details

  • Constructor Details

    • TestHelper

      public TestHelper()
  • Method Details

    • adminJdbcConfig

      public static io.debezium.jdbc.JdbcConfiguration adminJdbcConfig()
    • defaultJdbcConfig

      public static io.debezium.jdbc.JdbcConfiguration defaultJdbcConfig()
    • defaultConfig

      public static io.debezium.config.Configuration.Builder defaultConfig()
      Returns a default configuration suitable for most test cases. Can be amended/overridden in individual tests as needed.
    • adminConnection

      public static io.debezium.connector.db2.Db2Connection adminConnection()
    • testConnection

      public static io.debezium.connector.db2.Db2Connection testConnection()
    • enableDbCdc

      public static void enableDbCdc(io.debezium.connector.db2.Db2Connection connection) throws SQLException
      Enables CDC for a given database, if not already enabled.
      Throws:
      SQLException - if anything unexpected fails
    • disableDbCdc

      public static void disableDbCdc(io.debezium.connector.db2.Db2Connection connection) throws SQLException
      Disables CDC for a given database, if not already disabled.
      Throws:
      SQLException - if anything unexpected fails
    • enableTableCdc

      public static void enableTableCdc(io.debezium.connector.db2.Db2Connection connection, String name) throws SQLException
      Enables CDC for a table if not already enabled and generates the wrapper functions for that table.
      Parameters:
      name - the name of the table, may not be null
      Throws:
      SQLException - if anything unexpected fails
    • enableTableCdc

      public static void enableTableCdc(io.debezium.connector.db2.Db2Connection connection, String schemaName, String tableName) throws SQLException
      Enables CDC for a table if not already enabled and generates the wrapper functions for that table.
      Parameters:
      schemaName - the name of the schema, may not be null
      tableName - the name of the table, may not be null
      Throws:
      SQLException - if anything unexpected fails
    • disableTableCdc

      public static void disableTableCdc(io.debezium.connector.db2.Db2Connection connection, String name) throws SQLException
      Disables CDC for a table for which it was enabled before.
      Parameters:
      name - the name of the table, may not be null
      Throws:
      SQLException - if anything unexpected fails
    • disableTableCdc

      public static void disableTableCdc(io.debezium.connector.db2.Db2Connection connection, String schemaName, String tableName) throws SQLException
      Disables CDC for a table for which it was enabled before.
      Parameters:
      schemaName - the name of the schema, may not be null
      tableName - the name of the table, may not be null
      Throws:
      SQLException - if anything unexpected fails
    • waitForSnapshotToBeCompleted

      public static void waitForSnapshotToBeCompleted() throws InterruptedException
      Throws:
      InterruptedException
    • refreshAndWait

      public static void refreshAndWait(io.debezium.connector.db2.Db2Connection connection) throws SQLException
      Throws:
      SQLException
    • waitForCDC

      public static void waitForCDC()