public class TestHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
private static String |
CDC_WRAPPERS_DML |
static Path |
DB_HISTORY_PATH |
private static String |
DISABLE_DB_CDC |
private static String |
DISABLE_TABLE_CDC |
private static String |
ENABLE_DB_CDC |
private static String |
ENABLE_TABLE_CDC |
private static String |
ENABLE_TABLE_CDC_WITH_CUSTOM_CAPTURE |
private static org.slf4j.Logger |
LOGGER |
private static String |
STATEMENTS_PLACEHOLDER |
static String |
TEST_DATABASE |
| Constructor and Description |
|---|
TestHelper() |
| Modifier and Type | Method and Description |
|---|---|
static io.debezium.connector.sqlserver.SqlServerConnection |
adminConnection() |
static io.debezium.jdbc.JdbcConfiguration |
adminJdbcConfig() |
static void |
createTestDatabase() |
static Configuration.Builder |
defaultConfig()
Returns a default configuration suitable for most test cases.
|
static io.debezium.jdbc.JdbcConfiguration |
defaultJdbcConfig() |
protected static void |
disableDbCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
Disables CDC for a given database, if not already disabled.
|
static void |
disableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
Disables CDC for a table for which it was enabled before.
|
static void |
dropTestDatabase() |
static void |
enableDbCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
Enables CDC for a given database, if not already enabled.
|
static void |
enableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
Enables CDC for a table if not already enabled and generates the wrapper
functions for that table.
|
static void |
enableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String tableName,
String captureName)
Enables CDC for a table with a custom capture name
functions for that table.
|
static io.debezium.connector.sqlserver.SqlServerConnection |
testConnection() |
static void |
waitForSnapshotToBeCompleted() |
private static final org.slf4j.Logger LOGGER
public static final Path DB_HISTORY_PATH
public static final String TEST_DATABASE
private static final String STATEMENTS_PLACEHOLDER
private static final String ENABLE_DB_CDC
private static final String DISABLE_DB_CDC
private static final String ENABLE_TABLE_CDC
private static final String ENABLE_TABLE_CDC_WITH_CUSTOM_CAPTURE
private static final String DISABLE_TABLE_CDC
private static final String CDC_WRAPPERS_DML
public static io.debezium.jdbc.JdbcConfiguration adminJdbcConfig()
public static io.debezium.jdbc.JdbcConfiguration defaultJdbcConfig()
public static Configuration.Builder defaultConfig()
public static void createTestDatabase()
public static void dropTestDatabase()
public static io.debezium.connector.sqlserver.SqlServerConnection adminConnection()
public static io.debezium.connector.sqlserver.SqlServerConnection testConnection()
public static void enableDbCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
throws SQLException
name - the name of the DB, may not be nullSQLException - if anything unexpected failsprotected static void disableDbCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
throws SQLException
name - the name of the DB, may not be nullSQLException - if anything unexpected failspublic static void enableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
throws SQLException
name - the name of the table, may not be nullSQLException - if anything unexpected failspublic static void enableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String tableName,
String captureName)
throws SQLException
name - the name of the table, may not be nullSQLException - if anything unexpected failspublic static void disableTableCdc(io.debezium.connector.sqlserver.SqlServerConnection connection,
String name)
throws SQLException
name - the name of the table, may not be nullSQLException - if anything unexpected failspublic static void waitForSnapshotToBeCompleted()
throws InterruptedException
InterruptedExceptionCopyright © 2019 JBoss by Red Hat. All rights reserved.