Class OracleConnectorIT

java.lang.Object
io.debezium.embedded.AbstractConnectorTest
io.debezium.connector.oracle.OracleConnectorIT
All Implemented Interfaces:
Testing

public class OracleConnectorIT extends AbstractConnectorTest
Integration test for the Debezium Oracle connector.
Author:
Gunnar Morling
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • MICROS_PER_SECOND

      private static final long MICROS_PER_SECOND
    • SNAPSHOT_COMPLETED_KEY

      private static final String SNAPSHOT_COMPLETED_KEY
      See Also:
    • ERROR_PROCESSING_FAIL_MESSAGE

      private static final String ERROR_PROCESSING_FAIL_MESSAGE
      See Also:
    • ERROR_PROCESSING_WARN_MESSAGE

      private static final String ERROR_PROCESSING_WARN_MESSAGE
      See Also:
    • skipAdapterRule

      public final org.junit.rules.TestRule skipAdapterRule
    • skipOptionRule

      public final org.junit.rules.TestRule skipOptionRule
    • connection

      private static io.debezium.connector.oracle.OracleConnection connection
  • Constructor Details

    • OracleConnectorIT

      public OracleConnectorIT()
  • Method Details

    • beforeClass

      public static void beforeClass() throws SQLException
      Throws:
      SQLException
    • closeConnection

      public static void closeConnection() throws SQLException
      Throws:
      SQLException
    • before

      public void before() throws SQLException
      Throws:
      SQLException
    • shouldSnapshotAndStreamWithHyphenedTableName

      @FixFor("DBZ-2452") public void shouldSnapshotAndStreamWithHyphenedTableName() throws Exception
      Throws:
      Exception
    • shouldTakeSnapshot

      public void shouldTakeSnapshot() throws Exception
      Throws:
      Exception
    • shouldContinueWithStreamingAfterSnapshot

      public void shouldContinueWithStreamingAfterSnapshot() throws Exception
      Throws:
      Exception
    • continueStreamingAfterSnapshot

      private void continueStreamingAfterSnapshot(Configuration config) throws Exception
      Throws:
      Exception
    • shouldStreamTransaction

      @FixFor("DBZ-1223") public void shouldStreamTransaction() throws Exception
      Throws:
      Exception
    • sendTxBatch

      private void sendTxBatch(Configuration config, int expectedRecordCount, int offset) throws SQLException, InterruptedException
      Throws:
      SQLException
      InterruptedException
    • assertTxBatch

      private void assertTxBatch(Configuration config, int expectedRecordCount, int offset) throws InterruptedException
      Throws:
      InterruptedException
    • shouldStreamAfterRestart

      public void shouldStreamAfterRestart() throws Exception
      Throws:
      Exception
    • shouldStreamAfterRestartAfterSnapshot

      public void shouldStreamAfterRestartAfterSnapshot() throws Exception
      Throws:
      Exception
    • shouldReadChangeStreamForExistingTable

      public void shouldReadChangeStreamForExistingTable() throws Exception
      Throws:
      Exception
    • deleteWithoutTombstone

      @FixFor("DBZ-835") public void deleteWithoutTombstone() throws Exception
      Throws:
      Exception
    • shouldReadChangeStreamForTableCreatedWhileStreaming

      public void shouldReadChangeStreamForTableCreatedWhileStreaming() throws Exception
      Throws:
      Exception
    • shouldReceiveHeartbeatAlsoWhenChangingTableIncludeListTables

      @FixFor("DBZ-800") public void shouldReceiveHeartbeatAlsoWhenChangingTableIncludeListTables() throws Exception
      Throws:
      Exception
    • shouldConsumeEventsWithMaskedAndTruncatedColumnsWithDatabaseName

      @FixFor("DBZ-775") public void shouldConsumeEventsWithMaskedAndTruncatedColumnsWithDatabaseName() throws Exception
      Throws:
      Exception
    • shouldConsumeEventsWithMaskedAndTruncatedColumnsWithoutDatabaseName

      @FixFor("DBZ-775") public void shouldConsumeEventsWithMaskedAndTruncatedColumnsWithoutDatabaseName() throws Exception
      Throws:
      Exception
    • shouldConsumeEventsWithMaskedAndTruncatedColumns

      public void shouldConsumeEventsWithMaskedAndTruncatedColumns(boolean useDatabaseName) throws Exception
      Throws:
      Exception
    • shouldRewriteIdentityKeyWithDatabaseName

      @FixFor("DBZ-775") public void shouldRewriteIdentityKeyWithDatabaseName() throws Exception
      Throws:
      Exception
    • shouldRewriteIdentityKeyWithoutDatabaseName

      @FixFor("DBZ-775") public void shouldRewriteIdentityKeyWithoutDatabaseName() throws Exception
      Throws:
      Exception
    • shouldRewriteIdentityKey

      private void shouldRewriteIdentityKey(boolean useDatabaseName) throws Exception
      Throws:
      Exception
    • shouldPropagateSourceTypeByDatatype

      @FixFor({"DBZ-1916","DBZ-1830"}) public void shouldPropagateSourceTypeByDatatype() throws Exception
      Throws:
      Exception
    • shouldTruncate

      @FixFor("DBZ-4385") public void shouldTruncate() throws Exception
      Throws:
      Exception
    • shouldNotTruncateWhenSkipped

      @FixFor("DBZ-4385") public void shouldNotTruncateWhenSkipped() throws Exception
      Throws:
      Exception
    • shouldHandleIntervalTypesAsInt64

      @FixFor("DBZ-1539") public void shouldHandleIntervalTypesAsInt64() throws Exception
      Throws:
      Exception
    • shouldHandleIntervalTypesAsString

      @FixFor("DBZ-1539") public void shouldHandleIntervalTypesAsString() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamChangesFromTableWithNumericDefaultValues

      @FixFor("DBZ-2624") public void shouldSnapshotAndStreamChangesFromTableWithNumericDefaultValues() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamChangesFromPartitionedTable

      @FixFor("DBZ-2683") public void shouldSnapshotAndStreamChangesFromPartitionedTable() throws Exception
      Throws:
      Exception
    • shouldAvroSerializeColumnsWithSpecialCharacters

      @FixFor("DBZ-2849") public void shouldAvroSerializeColumnsWithSpecialCharacters() throws Exception
      Throws:
      Exception
    • testArchiveLogScnBoundariesAreIncluded

      @FixFor("DBZ-2825") public void testArchiveLogScnBoundariesAreIncluded() throws Exception
      Throws:
      Exception
    • shouldConvertDatesSpecifiedAsStringInSQL

      @FixFor("DBZ-2784") public void shouldConvertDatesSpecifiedAsStringInSQL() throws Exception
      Throws:
      Exception
    • shouldConvertNumericAsStringDecimalHandlingMode

      @FixFor("DBZ-2733") public void shouldConvertNumericAsStringDecimalHandlingMode() throws Exception
      Throws:
      Exception
    • assertRecordSchemaAndValues

      protected void assertRecordSchemaAndValues(List<SchemaAndValueField> expectedByColumn, org.apache.kafka.connect.source.SourceRecord record, String envelopeFieldName)
    • shouldStreamDdlThatExceeds4000

      @FixFor("DBZ-2920") public void shouldStreamDdlThatExceeds4000() throws Exception
      Throws:
      Exception
    • shouldNotObserveDeadlockWhileStreamingWithXstream

      @FixFor("DBZ-2891") public void shouldNotObserveDeadlockWhileStreamingWithXstream() throws Exception
      Throws:
      Exception
    • shouldReadTableUniqueIndicesWithCharactersThatRequireExplicitQuotes

      @FixFor("DBZ-3057") public void shouldReadTableUniqueIndicesWithCharactersThatRequireExplicitQuotes() throws Exception
      Throws:
      Exception
    • testSnapshotCompletesWithSystemGeneratedUniqueIndexOnKeylessTable

      @FixFor("DBZ-3151") public void testSnapshotCompletesWithSystemGeneratedUniqueIndexOnKeylessTable() throws Exception
      Throws:
      Exception
    • shouldGetOracleDatabaseVersion

      @FixFor("DBZ-3001") public void shouldGetOracleDatabaseVersion() throws Exception
      Throws:
      Exception
    • shouldStreamChangesForTableWithMultipleLogGroupTypes

      @FixFor("DBZ-3109") public void shouldStreamChangesForTableWithMultipleLogGroupTypes() throws Exception
      Throws:
      Exception
    • shouldResumeStreamingAtCorrectScnOffset

      @FixFor("DBZ-2875") public void shouldResumeStreamingAtCorrectScnOffset() throws Exception
      Throws:
      Exception
    • shouldHandleParentChildIndexOrganizedTables

      @FixFor("DBZ-3036") public void shouldHandleParentChildIndexOrganizedTables() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamClobDataTypes

      @FixFor("DBZ-3257") public void shouldSnapshotAndStreamClobDataTypes() throws Exception
      Throws:
      Exception
    • shouldContainPartitionInSchemaChangeEvent

      @FixFor("DBZ-3347") public void shouldContainPartitionInSchemaChangeEvent() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamTablesWithNoPrimaryKey

      @FixFor("DBZ-832") public void shouldSnapshotAndStreamTablesWithNoPrimaryKey() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamTablesWithUniqueIndexPrimaryKey

      @FixFor("DBZ-1211") public void shouldSnapshotAndStreamTablesWithUniqueIndexPrimaryKey() throws Exception
      Throws:
      Exception
    • shouldNotEmitEventsOnConstraintViolations

      @FixFor("DBZ-3322") public void shouldNotEmitEventsOnConstraintViolations() throws Exception
      Throws:
      Exception
    • shouldNotEmitEventsOnConstraintViolationsAcrossSessions

      @FixFor("DBZ-5090") public void shouldNotEmitEventsOnConstraintViolationsAcrossSessions() throws Exception
      Throws:
      Exception
    • shouldNotEmitEventsInRollbackTransaction

      @FixFor("DBZ-3322") public void shouldNotEmitEventsInRollbackTransaction() throws Exception
      Throws:
      Exception
    • shouldSelectivelySnapshotTables

      @FixFor("DBZ-3062") public void shouldSelectivelySnapshotTables() throws Exception
      Throws:
      Exception
    • shouldNotLogWarningsAboutCommittedTransactionsWhileStreamingNormally

      @FixFor("DBZ-3616") public void shouldNotLogWarningsAboutCommittedTransactionsWhileStreamingNormally() throws Exception
      Throws:
      Exception
    • shouldOutputRecordsInCloudEventsFormat

      @FixFor("DBZ-3668") public void shouldOutputRecordsInCloudEventsFormat() throws Exception
      Throws:
      Exception
    • shouldCaptureTableMetadataWithMultipleStatements

      @FixFor("DBZ-3896") public void shouldCaptureTableMetadataWithMultipleStatements() throws Exception
      Throws:
      Exception
    • shouldIgnoreAllTablesInExcludedSchemas

      @FixFor("DBZ-3898") public void shouldIgnoreAllTablesInExcludedSchemas() throws Exception
      Throws:
      Exception
    • shouldStartWithArchiveLogOnlyModeAndStreamWhenRecordsBecomeAvailable

      @FixFor({"DBZ-3712","DBZ-4879"}) public void shouldStartWithArchiveLogOnlyModeAndStreamWhenRecordsBecomeAvailable() throws Exception
      Throws:
      Exception
    • shouldPermitChangingToArchiveLogOnlyModeOnExistingConnector

      @FixFor("DBZ-3712") public void shouldPermitChangingToArchiveLogOnlyModeOnExistingConnector() throws Exception
      Throws:
      Exception
    • waitForLogSwitchOrForceOneAfterTimeout

      private void waitForLogSwitchOrForceOneAfterTimeout() throws SQLException
      Throws:
      SQLException
    • shouldFilterUser

      @FixFor("DBZ-3978") public void shouldFilterUser() throws Exception
      Throws:
      Exception
    • testShouldIgnoreCompressionAdvisorTablesDuringSnapshotAndStreaming

      @FixFor("DBZ-5756") public void testShouldIgnoreCompressionAdvisorTablesDuringSnapshotAndStreaming() throws Exception
      Throws:
      Exception
    • testShouldIgnoreCompressionAdvisorTablesDuringStreaming

      @FixFor("DBZ-5756") public void testShouldIgnoreCompressionAdvisorTablesDuringStreaming() throws Exception
      Throws:
      Exception
    • getStreamingMetric

      private <T> T getStreamingMetric(String metricName) throws JMException
      Throws:
      JMException
    • generateAlphaNumericStringColumn

      private String generateAlphaNumericStringColumn(int size)
    • verifyHeartbeatRecord

      private void verifyHeartbeatRecord(org.apache.kafka.connect.source.SourceRecord heartbeat)
    • toMicroSecondsSinceEpoch

      private long toMicroSecondsSinceEpoch(LocalDateTime localDateTime)
    • shouldCreateSnapshotSchemaOnlyRecoveryExceptionWithoutOffset

      @FixFor("DBZ-3986") public void shouldCreateSnapshotSchemaOnlyRecoveryExceptionWithoutOffset()
    • shouldCreateSnapshotSchemaOnlyRecovery

      @FixFor("DBZ-3986") public void shouldCreateSnapshotSchemaOnlyRecovery() throws Exception
      Throws:
      Exception
    • shouldCreateSnapshotSchemaOnlyExceptionWithoutHistory

      @FixFor("DBZ-3986") public void shouldCreateSnapshotSchemaOnlyExceptionWithoutHistory() throws Exception
      Throws:
      Exception
    • shouldSkipDataOnSnapshotSchemaOnly

      @FixFor("DBZ-3986") public void shouldSkipDataOnSnapshotSchemaOnly() throws Exception
      Throws:
      Exception
    • shouldWarnAboutTableNameLengthExceeded

      @FixFor("DBZ-4161") public void shouldWarnAboutTableNameLengthExceeded() throws Exception
      Throws:
      Exception
    • shouldWarnAboutColumnNameLengthExceeded

      @FixFor("DBZ-4161") public void shouldWarnAboutColumnNameLengthExceeded() throws Exception
      Throws:
      Exception
    • shouldSafelySnapshotAndStreamWithDatabaseIncludeList

      @FixFor("DBZ-3611") public void shouldSafelySnapshotAndStreamWithDatabaseIncludeList() throws Exception
      Throws:
      Exception
    • shouldSafelySnapshotAndStreamWithDatabaseExcludeList

      @FixFor("DBZ-3611") public void shouldSafelySnapshotAndStreamWithDatabaseExcludeList() throws Exception
      database include/exclude list are not support (yet) for the Oracle connector; this test is just there to make sure that the presence of these (functionally ignored) properties doesn't cause any problems.
      Throws:
      Exception
    • shouldNotRaiseNullPointerExceptionWithNonUppercaseDatabaseName

      @FixFor("DBZ-4376") public void shouldNotRaiseNullPointerExceptionWithNonUppercaseDatabaseName() throws Exception
      Throws:
      Exception
    • consumeRecords

      @FixFor("DBZ-3986") private void consumeRecords(Configuration config) throws SQLException, InterruptedException
      Throws:
      SQLException
      InterruptedException
    • shouldCaptureChangesForTransactionsAcrossSnapshotBoundary

      @FixFor("DBZ-4367") public void shouldCaptureChangesForTransactionsAcrossSnapshotBoundary() throws Exception
      Throws:
      Exception
    • shouldCaptureChangesForTransactionsAcrossSnapshotBoundaryWithoutDuplicatingSnapshottedChanges

      @FixFor("DBZ-4367") public void shouldCaptureChangesForTransactionsAcrossSnapshotBoundaryWithoutDuplicatingSnapshottedChanges() throws Exception
      Throws:
      Exception
    • shouldCaptureChangesForTransactionsAcrossSnapshotBoundaryWithoutReemittingDDLChanges

      @FixFor("DBZ-4367") public void shouldCaptureChangesForTransactionsAcrossSnapshotBoundaryWithoutReemittingDDLChanges() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamAllRecordsThatSpanAcrossSnapshotStreamingBoundarySmallTrxs

      @FixFor("DBZ-5085") public void shouldSnapshotAndStreamAllRecordsThatSpanAcrossSnapshotStreamingBoundarySmallTrxs() throws Exception
      Throws:
      Exception
    • shouldSnapshotAndStreamAllRecordsThatSpanAcrossSnapshotStreamingBoundaryLargeTrxs

      @FixFor("DBZ-5085") public void shouldSnapshotAndStreamAllRecordsThatSpanAcrossSnapshotStreamingBoundaryLargeTrxs() throws Exception
      Throws:
      Exception
    • shouldRestartAfterCapturedTableIsDroppedWhileConnectorDown

      @FixFor("DBZ-4842") public void shouldRestartAfterCapturedTableIsDroppedWhileConnectorDown() throws Exception
      Throws:
      Exception
    • shouldCaptureChangeForTableWithUnsupportedColumnType

      @FixFor("DBZ-4852") public void shouldCaptureChangeForTableWithUnsupportedColumnType() throws Exception
      Throws:
      Exception
    • shouldCaptureChangeForTableWithUnsupportedColumnTypeLong

      @FixFor("DBZ-4853") public void shouldCaptureChangeForTableWithUnsupportedColumnTypeLong() throws Exception
      Throws:
      Exception
    • shouldContinueToUpdateOffsetsEvenWhenTableIsNotChanged

      @FixFor("DBZ-4907") public void shouldContinueToUpdateOffsetsEvenWhenTableIsNotChanged() throws Exception
      Throws:
      Exception
    • shouldNotEmitLastCommittedTransactionEventsUponRestart

      @FixFor("DBZ-4936") public void shouldNotEmitLastCommittedTransactionEventsUponRestart() throws Exception
      Throws:
      Exception
    • shouldSuccessfullyConnectAndStreamWithDatabaseUrl

      @FixFor("DbZ-3318") public void shouldSuccessfullyConnectAndStreamWithDatabaseUrl() throws Exception
      Throws:
      Exception
    • shouldStreamTruncateEventWhenLobIsEnabled

      @FixFor("DBZ-4953") public void shouldStreamTruncateEventWhenLobIsEnabled() throws Exception
      Throws:
      Exception
    • shouldRestartLogMiningSessionAfterMaxSessionElapses

      @FixFor("DBZ-4963") public void shouldRestartLogMiningSessionAfterMaxSessionElapses() throws Exception
      Throws:
      Exception
    • shouldNotRestartLogMiningSessionWithMaxSessionZero

      @FixFor("DBZ-4963") public void shouldNotRestartLogMiningSessionWithMaxSessionZero() throws Exception
      Throws:
      Exception
    • shouldSupportTablesWithForwardSlashes

      @FixFor("DBZ-5006") public void shouldSupportTablesWithForwardSlashes() throws Exception
      Throws:
      Exception
    • shouldExecuteHeartbeatActionQuery

      @FixFor("DBZ-5119") public void shouldExecuteHeartbeatActionQuery() throws Exception
      Throws:
      Exception
    • shouldStopWhenErrorProcessingFailureHandlingModeIsDefault

      @FixFor("DBZ-5147") public void shouldStopWhenErrorProcessingFailureHandlingModeIsDefault() throws Exception
      Throws:
      Exception
    • shouldLogWarningAndSkipWhenErrorProcessingFailureHandlingModeIsWarn

      @FixFor("DBZ-5147") public void shouldLogWarningAndSkipWhenErrorProcessingFailureHandlingModeIsWarn() throws Exception
      Throws:
      Exception
    • shouldSilentlySkipWhenErrorProcessingFailureHandlingModeIsSkip

      @FixFor("DBZ-5147") public void shouldSilentlySkipWhenErrorProcessingFailureHandlingModeIsSkip() throws Exception
      Throws:
      Exception
    • shouldDiscardTransactionThatExceedsEventThreshold

      @FixFor("DBZ-5139") public void shouldDiscardTransactionThatExceedsEventThreshold() throws Exception
      Throws:
      Exception
    • shouldNotDiscardTransactionWhenNoEventThresholdSet

      @FixFor("DBZ-5139") public void shouldNotDiscardTransactionWhenNoEventThresholdSet() throws Exception
      Throws:
      Exception
    • shouldUniqueIndexWhenAtLeastOneColumnIsExcluded

      @FixFor("DBZ-5356") public void shouldUniqueIndexWhenAtLeastOneColumnIsExcluded() throws Exception
      Throws:
      Exception
    • testTableWithForwardSlashes

      private void testTableWithForwardSlashes(String tableName, String topicTableName) throws Exception
      Throws:
      Exception
    • shouldGracefullySkipObjectBasedTables

      @FixFor("DBZ-5441") public void shouldGracefullySkipObjectBasedTables() throws Exception
      Throws:
      Exception
    • shouldCaptureChangesForTableUniqueIndexWithNullColumnValuesWhenLobEnabled

      @FixFor("DBZ-5682") public void shouldCaptureChangesForTableUniqueIndexWithNullColumnValuesWhenLobEnabled() throws Exception
      Throws:
      Exception
    • shouldNotUseOffsetScnWhenSnapshotIsAlways

      @FixFor("DBZ-5626") public void shouldNotUseOffsetScnWhenSnapshotIsAlways() throws Exception
      Throws:
      Exception
    • shouldSkipSnapshotOfNestedTable

      @FixFor("DBZ-5738") public void shouldSkipSnapshotOfNestedTable() throws Exception
      Throws:
      Exception
    • shouldUndoOnlyLastEventWithSavepoint

      @FixFor("DBZ-5907") public void shouldUndoOnlyLastEventWithSavepoint() throws Exception
      Throws:
      Exception
    • shouldCorrectlyUndoWithMultipleSavepoints

      @FixFor("DBZ-5907") public void shouldCorrectlyUndoWithMultipleSavepoints() throws Exception
      Throws:
      Exception
    • shouldNotConsolidateBulkUpdateWhenLobEnabledIfUpdatesAreDifferentLogicalRowsWithoutLobColumns

      @FixFor("DBZ-6107") public void shouldNotConsolidateBulkUpdateWhenLobEnabledIfUpdatesAreDifferentLogicalRowsWithoutLobColumns() throws Exception
      Throws:
      Exception
    • shouldNotConsolidateBulkUpdateWhenLobEnabledIfUpdatesAreDifferentLogicalRowsWithLobColumns

      @FixFor("DBZ-6107") public void shouldNotConsolidateBulkUpdateWhenLobEnabledIfUpdatesAreDifferentLogicalRowsWithLobColumns() throws Exception
      Throws:
      Exception
    • testCapturingChangesForTableWithSapcesInName

      @FixFor("DBZ-6120") public void testCapturingChangesForTableWithSapcesInName() throws Exception
      Throws:
      Exception
    • testCapturingChangesForTableWithSpecialCharactersInName

      @FixFor("DBZ-6120") public void testCapturingChangesForTableWithSpecialCharactersInName() throws Exception
      Throws:
      Exception
    • testTimestampWithTimeZoneFormatConsistentUsingDriverEnabledTimestampTzInGmt

      @FixFor("DBZ-6143") public void testTimestampWithTimeZoneFormatConsistentUsingDriverEnabledTimestampTzInGmt() throws Exception
      Throws:
      Exception
    • testTimestampWithTimeZoneFormatConsistentUsingDriverDisabledTimestampTzInGmt

      @FixFor("DBZ-6143") public void testTimestampWithTimeZoneFormatConsistentUsingDriverDisabledTimestampTzInGmt() throws Exception
      Throws:
      Exception
    • waitForCurrentScnToHaveBeenSeenByConnector

      private void waitForCurrentScnToHaveBeenSeenByConnector() throws SQLException
      Throws:
      SQLException
    • getAfter

      private org.apache.kafka.connect.data.Struct getAfter(org.apache.kafka.connect.source.SourceRecord record)