public class TestHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONNECTOR_NAME |
static String |
CONNECTOR_USER |
static String |
CONNECTOR_USER_PASS |
static String |
DATABASE |
private static String |
DATABASE_ADMIN_PREFIX |
static String |
DATABASE_CDB |
private static String |
DATABASE_PREFIX |
static Path |
DB_HISTORY_PATH |
static String |
HOST |
private static String |
PDB_NAME |
static int |
PORT |
static String |
SCHEMA_PASS |
static String |
SCHEMA_USER |
static String |
SERVER_NAME |
static String |
TYPE_LENGTH_PARAMETER_KEY
Key for schema parameter used to store a source column's type length.
|
static String |
TYPE_NAME_PARAMETER_KEY
Key for schema parameter used to store a source column's type name.
|
static String |
TYPE_SCALE_PARAMETER_KEY
Key for schema parameter used to store a source column's type scale.
|
| Constructor and Description |
|---|
TestHelper() |
| Modifier and Type | Method and Description |
|---|---|
static io.debezium.connector.oracle.OracleConnectorConfig.ConnectorAdapter |
adapter() |
private static Configuration.Builder |
adminConfig()
Returns a configuration builder based on the administrator account settings.
|
static io.debezium.connector.oracle.OracleConnection |
adminConnection()
Return a connection that is suitable for performing test database changes that require
an administrator role permission.
|
private static JdbcConfiguration |
adminJdbcConfig()
Returns a JdbcConfiguration for the database administrator account.
|
private static io.debezium.connector.oracle.OracleConnection |
createConnection(Configuration config,
Configuration jdbcConfig,
boolean autoCommit)
Create an OracleConnection.
|
static Configuration.Builder |
defaultConfig()
Returns a JdbcConfiguration that is specific and suitable for initializing the connector.
|
static io.debezium.connector.oracle.OracleConnection |
defaultConnection()
Obtain a connection using the default configuration, i.e.
|
private static JdbcConfiguration |
defaultJdbcConfig()
Returns a JdbcConfiguration that is specific for the XStream/LogMiner user accounts.
|
static int |
defaultMessageConsumerPollTimeout() |
static void |
dropTable(io.debezium.connector.oracle.OracleConnection connection,
String table) |
static void |
forceFlushOfRedoLogsToArchiveLogs() |
static void |
forceLogfileSwitch() |
static String |
getConnectorUserName()
Get the name of the connector user, the default is
CONNECTOR_USER. |
private static String |
getConnectorUserPassword()
Get the password of the connector user, the default is
CONNECTOR_USER_PASS. |
private static Configuration |
getDatabaseConfig(String prefix)
Retrieves all settings provided by system properties based on the supplied
prefix. |
static String |
getDatabaseName()
Get the database name, the default is
DATABASE. |
static int |
getNumberOfOnlineLogGroups() |
static void |
purgeRecycleBin(io.debezium.connector.oracle.OracleConnection connection)
Clear the recycle bin, removing all objects from the bin and release all space associated
with objects in the recycle bin.
|
static void |
streamTable(io.debezium.connector.oracle.OracleConnection connection,
String table)
Enables a given table to be streamed by Oracle.
|
private static Configuration.Builder |
testConfig()
Returns a configuration builder based on the test schema and user account settings.
|
static io.debezium.connector.oracle.OracleConnection |
testConnection()
Return a test connection that is suitable for performing test database changes in tests.
|
private static JdbcConfiguration |
testJdbcConfig()
Returns a JdbcConfiguration for the test schema and user account.
|
private static final String PDB_NAME
private static final String DATABASE_PREFIX
private static final String DATABASE_ADMIN_PREFIX
public static final Path DB_HISTORY_PATH
public static final String CONNECTOR_USER
public static final String CONNECTOR_NAME
public static final String SERVER_NAME
public static final String CONNECTOR_USER_PASS
public static final String HOST
public static final String SCHEMA_USER
public static final String SCHEMA_PASS
public static final String DATABASE
public static final String DATABASE_CDB
public static final int PORT
public static final String TYPE_NAME_PARAMETER_KEY
public static final String TYPE_LENGTH_PARAMETER_KEY
public static final String TYPE_SCALE_PARAMETER_KEY
public static String getConnectorUserName()
CONNECTOR_USER.private static String getConnectorUserPassword()
CONNECTOR_USER_PASS.public static String getDatabaseName()
DATABASE.private static JdbcConfiguration defaultJdbcConfig()
public static Configuration.Builder defaultConfig()
database.pdb.name setting; however the value
of the setting should be empty. This is specific to the test suite only.public static io.debezium.connector.oracle.OracleConnection defaultConnection()
private static JdbcConfiguration testJdbcConfig()
private static JdbcConfiguration adminJdbcConfig()
private static Configuration.Builder testConfig()
private static Configuration.Builder adminConfig()
private static Configuration getDatabaseConfig(String prefix)
prefix.prefix - the key prefix to limit the settings based upon, i.e. database..public static io.debezium.connector.oracle.OracleConnection testConnection()
public static io.debezium.connector.oracle.OracleConnection adminConnection()
private static io.debezium.connector.oracle.OracleConnection createConnection(Configuration config, Configuration jdbcConfig, boolean autoCommit)
config - the connector configurationjdbcConfig - the JDBC configurationautoCommit - whether the connection should enforce auto-commitpublic static void forceLogfileSwitch()
public static int getNumberOfOnlineLogGroups()
public static void forceFlushOfRedoLogsToArchiveLogs()
public static void dropTable(io.debezium.connector.oracle.OracleConnection connection,
String table)
public static void streamTable(io.debezium.connector.oracle.OracleConnection connection,
String table)
throws SQLException
connection - the oracle connectiontable - the table name in schema.table format.SQLException - if an exception occurredpublic static void purgeRecycleBin(io.debezium.connector.oracle.OracleConnection connection)
connection - the oracle connectionpublic static int defaultMessageConsumerPollTimeout()
public static io.debezium.connector.oracle.OracleConnectorConfig.ConnectorAdapter adapter()
Copyright © 2021 JBoss by Red Hat. All rights reserved.