Package io.debezium.connector.mysql
Class AbstractMySqlConnectorOutputTest
java.lang.Object
io.debezium.embedded.ConnectorOutputTest
io.debezium.connector.mysql.AbstractMySqlConnectorOutputTest
Run the
MySqlConnector in various configurations and against different MySQL server instances
and verify the output is as expected.- Author:
- Randall Hauch
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.embedded.ConnectorOutputTest
ConnectorOutputTest.InputStreamSupplier, ConnectorOutputTest.OutputStreamSupplier, ConnectorOutputTest.TestData, ConnectorOutputTest.TestSpecification, ConnectorOutputTest.VariableSupplier -
Field Summary
FieldsFields inherited from class io.debezium.embedded.ConnectorOutputTest
CONNECTOR_OUTPUT_PATH, CONTROL_END, CONTROL_KEY, CONTROL_RESTART, CONTROL_STOP, DEFAULT_CONNECTOR_PROPERTIES_FILENAME, DEFAULT_ENV_PROPERTIES_FILENAME, DEFAULT_EXPECTED_RECORDS_FILENAME, ENV_CONNECTOR_TIMEOUT_IN_SECONDS, ENV_IGNORE_FIELDS, OFFSET_STORE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddValueComparatorsByFieldPath(BiConsumer<String, VerifyRecord.RecordValueComparator> comparatorsByPath) protected voidassertSameGtidSet(String pathToField, Object actual, Object expected) protected String[]private static io.debezium.connector.mysql.GtidSetreadAvailableGtidSet(Configuration config) readSystemVariables(Configuration config) Read the system variables and master status using the given connector configuration.protected static voidwaitForGtidSetsToMatch(Configuration master, Configuration replica) Wait up to 10 seconds until the replica catches up with the master.protected static voidwaitForGtidSetsToMatch(Configuration master, Configuration replica, long timeout, TimeUnit unit) Wait a maximum amount of time until the replica catches up with the master.Methods inherited from class io.debezium.embedded.ConnectorOutputTest
addValueComparatorsBySchemaName, afterEachTestMethod, cleanOffsetStorage, replaceVariables, runConnector, runConnector, runConnector, runConnector, runConnector, runConnector, usingSpec, usingSpec, usingSpec, usingSpec, usingSpec
-
Field Details
-
logger
private final org.slf4j.Logger logger
-
-
Constructor Details
-
AbstractMySqlConnectorOutputTest
public AbstractMySqlConnectorOutputTest()
-
-
Method Details
-
readAvailableGtidSet
-
waitForGtidSetsToMatch
Wait up to 10 seconds until the replica catches up with the master.- Parameters:
master- the configuration with theRelationalDatabaseConnectorConfig.HOSTNAMEandMySqlConnectorConfig.PORTconfiguration properties for the MySQL master; may not be nullreplica- the configuration with theRelationalDatabaseConnectorConfig.HOSTNAMEandMySqlConnectorConfig.PORTconfiguration properties for the MySQL replica; may not be null- See Also:
-
waitForGtidSetsToMatch
protected static void waitForGtidSetsToMatch(Configuration master, Configuration replica, long timeout, TimeUnit unit) Wait a maximum amount of time until the replica catches up with the master.- Parameters:
master- the configuration with theRelationalDatabaseConnectorConfig.HOSTNAMEandMySqlConnectorConfig.PORTconfiguration properties for the MySQL master; may not be nullreplica- the configuration with theRelationalDatabaseConnectorConfig.HOSTNAMEandMySqlConnectorConfig.PORTconfiguration properties for the MySQL replica; may not be nulltimeout- the maximum amount of time to waitunit- the time unit for the timeout- See Also:
-
readSystemVariables
Read the system variables and master status using the given connector configuration. This can be used when creatingConnectorOutputTest.TestSpecificationinstanceswith variables.When connected to a replica, the GTID source for the master is added to the variables using the "@{code master_uuid}" variable, which does not correspond to a real MySQL system variable. The GTID source of the server to which the test case connects is given by the "
server_uuid" system variable.- Parameters:
config- the connector configuration; never null- Returns:
- the available system variables
- Throws:
Exception- if there is a problem connecting to the database and reading the system variables
-
globallyIgnorableFieldNames
- Overrides:
globallyIgnorableFieldNamesin classConnectorOutputTest
-
addValueComparatorsByFieldPath
protected void addValueComparatorsByFieldPath(BiConsumer<String, VerifyRecord.RecordValueComparator> comparatorsByPath) - Overrides:
addValueComparatorsByFieldPathin classConnectorOutputTest
-
assertSameGtidSet
-