Package io.debezium.connector.sqlserver
Class SQLServerNumericColumnIT
- java.lang.Object
-
- io.debezium.embedded.AbstractConnectorTest
-
- io.debezium.connector.sqlserver.SQLServerNumericColumnIT
-
- All Implemented Interfaces:
Testing
public class SQLServerNumericColumnIT extends AbstractConnectorTest
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.SourceRecords
-
Nested classes/interfaces inherited from interface io.debezium.util.Testing
Testing.Debug, Testing.Files, Testing.InterruptableFunction, Testing.Network, Testing.Print, Testing.Timer
-
-
Field Summary
Fields Modifier and Type Field Description private io.debezium.connector.sqlserver.SqlServerConnectionconnection-
Fields inherited from class io.debezium.embedded.AbstractConnectorTest
engine, logger, logTestName, OFFSET_STORE_PATH, pollTimeoutInMs, skipTestRule
-
-
Constructor Summary
Constructors Constructor Description SQLServerNumericColumnIT()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter()private voidassertSchema(org.apache.kafka.connect.data.Struct valueA, org.apache.kafka.connect.data.Schema expected)voidbefore()Create 2 Tables.voiddecimalModeConfigDouble()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 formatvoiddecimalModeConfigPrecise()Insert 1 Record into tablenumc withDecimalHandlingMode.PRECISEmode Assertions: - Connector is running - 1 Record are streamed out of cdc - Assert cola, colb, colc, cold are bytesvoiddecimalModeConfigString()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.-
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, debug, getMaximumEnqueuedRecordCount, getSnapshotMetricsObjectName, getStreamingMetricsObjectName, getStreamingMetricsObjectName, getStreamingNamespace, initializeConnectorTestFramework, isStreamingRunning, isStreamingRunning, isTransactionRecord, loggingCompletion, print, readLastCommittedOffset, readLastCommittedOffsets, setConsumeTimeout, skipAvroValidation, start, start, start, start, start, startAndConsumeTillEnd, stopConnector, stopConnector, validate, waitForAvailableRecords, waitForConnectorShutdown, waitForSnapshotToBeCompleted, waitForStreamingRunning, waitForStreamingRunning, waitTimeForRecords, waitTimeForRecordsAfterNulls
-
-
-
-
Method Detail
-
before
public void before() throws SQLExceptionCreate 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
public void after() throws SQLException- Throws:
SQLException
-
decimalModeConfigString
public void decimalModeConfigString() throws ExceptionInsert 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
public void decimalModeConfigDouble() throws ExceptionInsert 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
public void decimalModeConfigPrecise() throws ExceptionInsert 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)
-
-