DBZ-3684 OracleSchemaMigrationIT - Fix possible false positive test failure
This commit is contained in:
parent
51825b0b47
commit
237a71ea3c
@ -49,13 +49,13 @@ public void beforeEach() throws Exception {
|
||||
initializeConnectorTestFramework();
|
||||
Testing.Files.delete(TestHelper.DB_HISTORY_PATH);
|
||||
|
||||
TestHelper.dropTables(connection, "debezium_signal", "tablea", "tableb", "\"tableC\"");
|
||||
TestHelper.dropAllTables();
|
||||
}
|
||||
|
||||
@After
|
||||
public void afterEach() throws Exception {
|
||||
if (connection != null) {
|
||||
TestHelper.dropTables(connection, "tablea", "tableb", "\"tableC\"");
|
||||
TestHelper.dropAllTables();
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
@ -387,4 +387,20 @@ public static OracleConnectorConfig.ConnectorAdapter adapter() {
|
||||
final String s = System.getProperty(OracleConnectorConfig.CONNECTOR_ADAPTER.name());
|
||||
return (s == null || s.length() == 0) ? OracleConnectorConfig.ConnectorAdapter.LOG_MINER : OracleConnectorConfig.ConnectorAdapter.parse(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops all tables visible to user {@link #SCHEMA_USER}.
|
||||
*/
|
||||
public static void dropAllTables() {
|
||||
try (OracleConnection connection = testConnection()) {
|
||||
connection.query("SELECT TABLE_NAME FROM USER_TABLES", rs -> {
|
||||
while (rs.next()) {
|
||||
connection.execute("DROP TABLE " + rs.getString(1));
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (SQLException e) {
|
||||
throw new RuntimeException("Failed to clean database");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user