Package io.debezium.connector.sqlserver
Class SQLServerNumericColumnIT
java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.sqlserver.SQLServerNumericColumnIT
- All Implemented Interfaces:
Testing
Tests for numeric/decimal columsn with precise, string and decimal options
- Author:
- Pradeep Mamillapalli
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.embedded.AbstractConnectorTest
AbstractConnectorTest.SourceRecordsNested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate io.debezium.connector.sqlserver.SqlServerConnectionFields inherited from class io.debezium.embedded.AbstractConnectorTest
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private voidassertSchema(org.apache.kafka.connect.data.Struct valueA, org.apache.kafka.connect.data.Schema expected) voidbefore()Create 2 Tables.voidInsert 1 Record into tablenumb withDecimalHandlingMode.DOUBLEmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are exactly equal to the input values in double formatvoidInsert 1 Record into tablenumc withDecimalHandlingMode.PRECISEmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are bytesvoidInsert 1 Record into tablenuma withDecimalHandlingMode.STRINGmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are exactly equal to the input values.Methods inherited from class io.debezium.embedded.AbstractConnectorTest
assertBeginTransaction, assertConfigurationErrors, assertConfigurationErrors, assertConfigurationErrors, assertConnectorIsRunning, assertConnectorNotRunning, assertDelete, assertEndTransaction, assertEngineIsRunning, assertHasNoSourceQuery, assertInsert, assertKey, assertNoConfigurationErrors, assertNoRecordsToConsume, assertOffset, assertOffset, assertOnlyTransactionRecordsToConsume, assertRecordTransactionMetadata, assertSchemaMatchesStruct, assertSchemaMatchesStruct, assertSourceQuery, assertTombstone, assertTombstone, assertUpdate, assertValueField, configValue, consumeAvailableRecords, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeDmlRecordsByTopic, consumeRecord, consumeRecords, consumeRecords, consumeRecords, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopic, consumeRecordsByTopicUntil, consumeRecordsUntil, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, startAndConsumeTillEnd, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
Field Details
-
connection
private io.debezium.connector.sqlserver.SqlServerConnection connection
-
-
Constructor Details
-
SQLServerNumericColumnIT
public SQLServerNumericColumnIT()
-
-
Method Details
-
before
Create 2 Tables. Each table has 4 columns cola: Decimal(8,4) type with 8 precision and 4 scale colb: Decimal - Default precision(18) and default scale(0) colc: numeric(7,1) - 7 precision and 1 scale cold: numeric- Default precision(18) and default scale(0)- Throws:
SQLException
-
after
- Throws:
SQLException
-
decimalModeConfigString
Insert 1 Record into tablenuma withDecimalHandlingMode.STRINGmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are exactly equal to the input values.- Throws:
Exception
-
decimalModeConfigDouble
Insert 1 Record into tablenumb withDecimalHandlingMode.DOUBLEmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are exactly equal to the input values in double format- Throws:
Exception
-
decimalModeConfigPrecise
Insert 1 Record into tablenumc withDecimalHandlingMode.PRECISEmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are bytes- Throws:
Exception
-
assertSchema
private void assertSchema(org.apache.kafka.connect.data.Struct valueA, org.apache.kafka.connect.data.Schema expected)
-