From db60c2f26e0548e8d76bee4070d14421361637b9 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Thu, 23 Nov 2023 17:32:32 +0100 Subject: [PATCH 1/3] re-enabled v8 tests --- .project-keeper.yml | 2 +- doc/changes/changes_2.4.3.md | 6 +- pk_generated_parent.pom | 15 ++- pom.xml | 4 +- .../oracle/OracleScalarFunctionsIT.java | 104 +++++++++--------- 5 files changed, 70 insertions(+), 61 deletions(-) diff --git a/.project-keeper.yml b/.project-keeper.yml index 89ce87b..f035b05 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -13,4 +13,4 @@ excludes: - "E-PK-CORE-18: Outdated content: '.github/workflows/ci-build.yml'" - "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_upload_github_release_assets.yml'" - "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_prepare_original_checksum.yml'" -ciBuildRunnerOS: ubuntu-20.04 + diff --git a/doc/changes/changes_2.4.3.md b/doc/changes/changes_2.4.3.md index aa40254..198f0ee 100644 --- a/doc/changes/changes_2.4.3.md +++ b/doc/changes/changes_2.4.3.md @@ -31,6 +31,7 @@ This release adds integration tests using Exasol 8 and the extension code making * Updated `com.exasol:exasol-testcontainers:6.6.2` to `6.6.3` * Added `com.exasol:extension-manager-integration-test-java:0.5.6` * Updated `com.exasol:hamcrest-resultset-matcher:1.6.1` to `1.6.2` +* Updated `com.exasol:test-db-builder-java:3.5.1` to `3.5.2` * Added `com.oracle.database.jdbc:ojdbc8:23.3.0.23.09` * Updated `nl.jqno.equalsverifier:equalsverifier:3.15.2` to `3.15.3` * Updated `org.jacoco:org.jacoco.agent:0.8.10` to `0.8.11` @@ -40,9 +41,12 @@ This release adds integration tests using Exasol 8 and the extension code making #### Plugin Dependency Updates * Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` -* Updated `com.exasol:project-keeper-maven-plugin:2.9.12` to `2.9.15` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.12` to `2.9.16` * Updated `org.apache.maven.plugins:maven-clean-plugin:2.5` to `3.3.2` +* Updated `org.apache.maven.plugins:maven-dependency-plugin:3.6.0` to `3.6.1` * Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` to `3.4.1` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.1.2` to `3.2.2` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.1.2` to `3.2.2` * Added `org.codehaus.mojo:exec-maven-plugin:3.1.0` * Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` * Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 8cb7fdb..5b387fd 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -54,6 +54,12 @@ ${java.version} ${java.version} + true + + + -Xlint:all,-processing + + @@ -118,7 +124,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.2 @@ -222,7 +228,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.6.0 + 3.6.1 copy-jacoco @@ -242,10 +248,9 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 + 3.2.2 - + -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} true diff --git a/pom.xml b/pom.xml index efbdb44..d6f5105 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ com.exasol test-db-builder-java - 3.5.1 + 3.5.2 test @@ -156,7 +156,7 @@ com.exasol project-keeper-maven-plugin - 2.9.15 + 2.9.16 diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java b/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java index 9d92895..d645094 100644 --- a/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java +++ b/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java @@ -1,5 +1,14 @@ package com.exasol.adapter.dialects.oracle; +import static com.exasol.adapter.metadata.DataType.IntervalType.DAY_TO_SECOND; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.*; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.extension.ExtendWith; + import com.exasol.adapter.commontests.scalarfunction.ScalarFunctionsTestBase; import com.exasol.adapter.commontests.scalarfunction.TestSetup; import com.exasol.adapter.commontests.scalarfunction.virtualschematestsetup.*; @@ -12,19 +21,10 @@ import com.exasol.dbbuilder.dialects.Table; import com.exasol.dbbuilder.dialects.exasol.VirtualSchema; import com.exasol.dbbuilder.dialects.oracle.OracleObjectFactory; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.extension.ExtendWith; - -import java.sql.Connection; -import java.sql.SQLException; -import java.util.*; -import static com.exasol.adapter.metadata.DataType.IntervalType.DAY_TO_SECOND; - -@ExtendWith({CloseAfterAllExtension.class}) +@ExtendWith({ CloseAfterAllExtension.class }) class OracleScalarFunctionsIT extends ScalarFunctionsTestBase { - @CloseAfterAll private static final OracleVirtualSchemaIntegrationTestSetup SETUP = new OracleVirtualSchemaIntegrationTestSetup(); static int idCounter = 0; @@ -36,7 +36,7 @@ protected static String getUniqueIdentifier() { @BeforeAll static void assumeExasol71() throws SQLException { - ExasolVersionCheck.assumeExasolVersion7(SETUP.getExasolContainer().createConnection()); + // ExasolVersionCheck.assumeExasolVersion7(SETUP.getExasolContainer().createConnection()); } @Override @@ -71,24 +71,23 @@ static void beforeAll() { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } - public class OracleTestSetup implements TestSetup { final OracleObjectFactory oracleFactory; - OracleTestSetup(OracleObjectFactory oracleFactory) { + OracleTestSetup(final OracleObjectFactory oracleFactory) { this.oracleFactory = oracleFactory; } @Override public VirtualSchemaTestSetupProvider getVirtualSchemaTestSetupProvider() { return (final CreateVirtualSchemaTestSetupRequest request) -> { - //create schema in oracle DB with increasing ID, ID1, ID2, etc. + // create schema in oracle DB with increasing ID, ID1, ID2, etc. final Schema oracleSchema = oracleFactory.createSchema(getUniqueIdentifier()); for (final TableRequest tableRequest : request.getTableRequests()) { createTableInSchema(oracleSchema, tableRequest); } - //create a virtual schema with the same name as the oracle schema + // create a virtual schema with the same name as the oracle schema final VirtualSchema virtualSchema = SETUP.createVirtualSchema(oracleSchema.getName(), Collections.emptyMap()); @@ -96,11 +95,10 @@ public VirtualSchemaTestSetupProvider getVirtualSchemaTestSetupProvider() { }; } - //case sensitive!!! 1 on 1 + // case sensitive!!! 1 on 1 // .tolower() for the table and column names (brought over from postgresql) was causing trouble here. - private void createTableInSchema(Schema oracleSchema, TableRequest tableRequest) { - final Table.Builder tableBuilder = oracleSchema - .createTableBuilder(tableRequest.getName()); + private void createTableInSchema(final Schema oracleSchema, final TableRequest tableRequest) { + final Table.Builder tableBuilder = oracleSchema.createTableBuilder(tableRequest.getName()); for (final Column column : tableRequest.getColumns()) { tableBuilder.column(column.getName(), column.getType()); } @@ -110,47 +108,49 @@ private void createTableInSchema(Schema oracleSchema, TableRequest tableRequest) } } - //https://docs.exasol.com/db/latest/migration_guides/oracle/execution/datatypemapping.htm + // https://docs.exasol.com/db/latest/migration_guides/oracle/execution/datatypemapping.htm @Override public String getExternalTypeFor(final DataType exasolType) { switch (exasolType.getExaDataType()) { - case VARCHAR: - return "VARCHAR2(" + exasolType.getSize() + " CHAR)"; - case CHAR: - return "NCHAR2(" + exasolType.getSize() + ")"; - case DATE: - return "DATE"; - case TIMESTAMP: - return "TIMESTAMP (" + exasolType.getPrecision() + ")"; - case DOUBLE: - return "DOUBLE PRECISION"; - case DECIMAL: - return "DECIMAL"; - case BOOLEAN: - return "NUMBER(1)"; - case HASHTYPE: - return "RAW(" + exasolType.getSize() + ")"; - case INTERVAL: - if (exasolType.getIntervalType() == DAY_TO_SECOND) { - return "INTERVAL DAY(" + exasolType.getPrecision() + ") TO SECOND(" + exasolType.getIntervalFraction() + ")"; - } else { - return "INTERVAL YEAR(" + exasolType.getPrecision() + ") TO MONTH"; - } - default: - return exasolType.toString(); + case VARCHAR: + return "VARCHAR2(" + exasolType.getSize() + " CHAR)"; + case CHAR: + return "NCHAR2(" + exasolType.getSize() + ")"; + case DATE: + return "DATE"; + case TIMESTAMP: + return "TIMESTAMP (" + exasolType.getPrecision() + ")"; + case DOUBLE: + return "DOUBLE PRECISION"; + case DECIMAL: + return "DECIMAL"; + case BOOLEAN: + return "NUMBER(1)"; + case HASHTYPE: + return "RAW(" + exasolType.getSize() + ")"; + case INTERVAL: + if (exasolType.getIntervalType() == DAY_TO_SECOND) { + return "INTERVAL DAY(" + exasolType.getPrecision() + ") TO SECOND(" + + exasolType.getIntervalFraction() + ")"; + } else { + return "INTERVAL YEAR(" + exasolType.getPrecision() + ") TO MONTH"; + } + default: + return exasolType.toString(); } } @Override public Set getDialectSpecificExcludes() { - return Set.of("neg", - "upper(\"DOUBLE_PRECISION_C0\")",//oracle converts 0.5 to '.5' instead of '0.5' - "upper(\"DATE_C5\")",//different date formatting - "upper(\"TIMESTAMP_0_C6\")", //different timestamp formatting - "to_dsinterval", "numtoyminterval", "systimestamp", "cast", "current_timestamp", "numtodsinterval", "to_yminterval", - "character_length", "trim", "add_months", "char_length", "instr", "lower", "regexp_replace", "substr", "add_hours", "left", "mid", "add_weeks", - "add_minutes", "to_timestamp", "reverse", "regexp_instr", "soundex", "add_days", "add_years", "replace", "translate", "lpad", "ltrim", "regexp_substr", "ucase", "lcase", - "character_Length", "locate", "curdate", "substring", "rpad", "to_date", "to_char", "repeat", "to_number", "length", "rtrim", "add_seconds"); + return Set.of("neg", "upper(\"DOUBLE_PRECISION_C0\")", // oracle converts 0.5 to '.5' instead of '0.5' + "upper(\"DATE_C5\")", // different date formatting + "upper(\"TIMESTAMP_0_C6\")", // different timestamp formatting + "to_dsinterval", "numtoyminterval", "systimestamp", "cast", "current_timestamp", "numtodsinterval", + "to_yminterval", "character_length", "trim", "add_months", "char_length", "instr", "lower", + "regexp_replace", "substr", "add_hours", "left", "mid", "add_weeks", "add_minutes", "to_timestamp", + "reverse", "regexp_instr", "soundex", "add_days", "add_years", "replace", "translate", "lpad", + "ltrim", "regexp_substr", "ucase", "lcase", "character_Length", "locate", "curdate", "substring", + "rpad", "to_date", "to_char", "repeat", "to_number", "length", "rtrim", "add_seconds"); } @Override From 40c0d98b3681f2affd4ccd57208aeec93f880868 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 27 Nov 2023 13:54:54 +0100 Subject: [PATCH 2/3] PR feedback --- doc/changes/changes_2.4.3.md | 3 +++ .../adapter/dialects/oracle/OracleScalarFunctionsIT.java | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/changes/changes_2.4.3.md b/doc/changes/changes_2.4.3.md index 198f0ee..56121d8 100644 --- a/doc/changes/changes_2.4.3.md +++ b/doc/changes/changes_2.4.3.md @@ -4,6 +4,9 @@ Code name: Test with Exasol 8 ## Summary +Closes #33 : Update tests to V8 VSORA +Closes #38 : Added extension for Extension Manager + This release adds integration tests using Exasol 8 and the extension code making VSORA available in the [Exasol Extension Manager](https://github.com/exasol/extension-manager). Please note that the VSORA extension expects the Oracle JDBC driver `ojdbc8.jar` in BucketFS. If this file is missing, the extension won't be available in Extension Manager. **Note:** This release removes the Oracle JDBC driver from the adapter JAR file that was accidentally included in version 2.1.0. This means that you will need to define the `ADAPTER SCRIPT` specifying both the adapter JAR and the JDBC driver JAR as described in the [user guide](../user_guide/oracle_user_guide.md#installing-the-adapter-script). diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java b/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java index d645094..3fe57a4 100644 --- a/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java +++ b/src/test/java/com/exasol/adapter/dialects/oracle/OracleScalarFunctionsIT.java @@ -34,11 +34,6 @@ protected static String getUniqueIdentifier() { return "ID" + idCounter; } - @BeforeAll - static void assumeExasol71() throws SQLException { - // ExasolVersionCheck.assumeExasolVersion7(SETUP.getExasolContainer().createConnection()); - } - @Override protected TestSetup getTestSetup() { final OracleObjectFactory oracleFactory = SETUP.getOracleFactory(); From 16d66621f3c99dd72202a3dadf1700041ffe5f61 Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 27 Nov 2023 14:46:43 +0100 Subject: [PATCH 3/3] remove duplicates --- doc/changes/changes_2.4.3.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/changes/changes_2.4.3.md b/doc/changes/changes_2.4.3.md index 56121d8..198f0ee 100644 --- a/doc/changes/changes_2.4.3.md +++ b/doc/changes/changes_2.4.3.md @@ -4,9 +4,6 @@ Code name: Test with Exasol 8 ## Summary -Closes #33 : Update tests to V8 VSORA -Closes #38 : Added extension for Extension Manager - This release adds integration tests using Exasol 8 and the extension code making VSORA available in the [Exasol Extension Manager](https://github.com/exasol/extension-manager). Please note that the VSORA extension expects the Oracle JDBC driver `ojdbc8.jar` in BucketFS. If this file is missing, the extension won't be available in Extension Manager. **Note:** This release removes the Oracle JDBC driver from the adapter JAR file that was accidentally included in version 2.1.0. This means that you will need to define the `ADAPTER SCRIPT` specifying both the adapter JAR and the JDBC driver JAR as described in the [user guide](../user_guide/oracle_user_guide.md#installing-the-adapter-script).