diff --git a/dependencies.md b/dependencies.md index ba47bb1..c82d523 100644 --- a/dependencies.md +++ b/dependencies.md @@ -3,31 +3,31 @@ ## Compile Dependencies -| Dependency | License | -| ------------------------------------------ | ------------------------------------------------ | -| [Virtual Schema Common JDBC][0] | [MIT License][1] | -| [Exasol Database fundamentals for Java][2] | [MIT License][3] | -| [error-reporting-java][4] | [MIT License][5] | -| [ojdbc8][6] | [Oracle Free Use Terms and Conditions (FUTC)][7] | +| Dependency | License | +| ------------------------------------------ | ---------------- | +| [Virtual Schema Common JDBC][0] | [MIT License][1] | +| [Exasol Database fundamentals for Java][2] | [MIT License][3] | +| [error-reporting-java][4] | [MIT License][5] | ## Test Dependencies -| Dependency | License | -| ----------------------------------------------- | --------------------------------- | -| [Virtual Schema Common JDBC][0] | [MIT License][1] | -| [Hamcrest][8] | [BSD License 3][9] | -| [JUnit Jupiter (Aggregator)][10] | [Eclipse Public License v2.0][11] | -| [mockito-junit-jupiter][12] | [MIT][13] | -| [EqualsVerifier \| release normal jar][14] | [Apache License, Version 2.0][15] | -| [SLF4J JDK14 Provider][16] | [MIT License][17] | -| [Test containers for Exasol on Docker][18] | [MIT License][19] | -| [Testcontainers :: JUnit Jupiter Extension][20] | [MIT][21] | -| [Testcontainers :: JDBC :: Oracle XE][20] | [MIT][21] | -| [Test Database Builder for Java][22] | [MIT License][23] | -| [udf-debugging-java][24] | [MIT License][25] | -| [Matcher for SQL Result Sets][26] | [MIT License][27] | -| [virtual-schema-shared-integration-tests][28] | [MIT License][29] | -| [JaCoCo :: Agent][30] | [Eclipse Public License 2.0][31] | +| Dependency | License | +| ----------------------------------------------- | ------------------------------------------------- | +| [Virtual Schema Common JDBC][0] | [MIT License][1] | +| [Hamcrest][6] | [BSD License 3][7] | +| [JUnit Jupiter (Aggregator)][8] | [Eclipse Public License v2.0][9] | +| [mockito-junit-jupiter][10] | [MIT][11] | +| [EqualsVerifier \| release normal jar][12] | [Apache License, Version 2.0][13] | +| [SLF4J JDK14 Provider][14] | [MIT License][15] | +| [Test containers for Exasol on Docker][16] | [MIT License][17] | +| [Testcontainers :: JUnit Jupiter Extension][18] | [MIT][19] | +| [Testcontainers :: JDBC :: Oracle XE][18] | [MIT][19] | +| [ojdbc8][20] | [Oracle Free Use Terms and Conditions (FUTC)][21] | +| [Test Database Builder for Java][22] | [MIT License][23] | +| [udf-debugging-java][24] | [MIT License][25] | +| [Matcher for SQL Result Sets][26] | [MIT License][27] | +| [virtual-schema-shared-integration-tests][28] | [MIT License][29] | +| [JaCoCo :: Agent][30] | [Eclipse Public License 2.0][31] | ## Runtime Dependencies @@ -40,19 +40,19 @@ | Dependency | License | | ------------------------------------------------------- | --------------------------------- | | [SonarQube Scanner for Maven][35] | [GNU LGPL 3][36] | -| [Apache Maven Compiler Plugin][37] | [Apache-2.0][15] | -| [Apache Maven Enforcer Plugin][38] | [Apache-2.0][15] | -| [Maven Flatten Plugin][39] | [Apache Software Licenese][15] | +| [Apache Maven Compiler Plugin][37] | [Apache-2.0][13] | +| [Apache Maven Enforcer Plugin][38] | [Apache-2.0][13] | +| [Maven Flatten Plugin][39] | [Apache Software Licenese][13] | | [org.sonatype.ossindex.maven:ossindex-maven-plugin][40] | [ASL2][41] | -| [Maven Surefire Plugin][42] | [Apache-2.0][15] | -| [Versions Maven Plugin][43] | [Apache License, Version 2.0][15] | +| [Maven Surefire Plugin][42] | [Apache-2.0][13] | +| [Versions Maven Plugin][43] | [Apache License, Version 2.0][13] | | [duplicate-finder-maven-plugin Maven Mojo][44] | [Apache License 2.0][45] | | [Project keeper maven plugin][46] | [The MIT License][47] | -| [Apache Maven Assembly Plugin][48] | [Apache-2.0][15] | -| [Apache Maven JAR Plugin][49] | [Apache License, Version 2.0][15] | +| [Apache Maven Assembly Plugin][48] | [Apache-2.0][13] | +| [Apache Maven JAR Plugin][49] | [Apache License, Version 2.0][13] | | [Artifact reference checker and unifier][50] | [MIT License][51] | -| [Apache Maven Dependency Plugin][52] | [Apache-2.0][15] | -| [Maven Failsafe Plugin][53] | [Apache-2.0][15] | +| [Apache Maven Dependency Plugin][52] | [Apache-2.0][13] | +| [Maven Failsafe Plugin][53] | [Apache-2.0][13] | | [JaCoCo :: Maven Plugin][54] | [Eclipse Public License 2.0][31] | | [error-code-crawler-maven-plugin][55] | [MIT License][56] | | [Reproducible Build Maven Plugin][57] | [Apache 2.0][41] | @@ -63,22 +63,22 @@ [3]: https://github.com/exasol/db-fundamentals-java/blob/main/LICENSE [4]: https://github.com/exasol/error-reporting-java/ [5]: https://github.com/exasol/error-reporting-java/blob/main/LICENSE -[6]: https://www.oracle.com/database/technologies/maven-central-guide.html -[7]: https://www.oracle.com/downloads/licenses/oracle-free-license.html -[8]: http://hamcrest.org/JavaHamcrest/ -[9]: http://opensource.org/licenses/BSD-3-Clause -[10]: https://junit.org/junit5/ -[11]: https://www.eclipse.org/legal/epl-v20.html -[12]: https://github.com/mockito/mockito -[13]: https://opensource.org/licenses/MIT -[14]: https://www.jqno.nl/equalsverifier -[15]: https://www.apache.org/licenses/LICENSE-2.0.txt -[16]: http://www.slf4j.org -[17]: http://www.opensource.org/licenses/mit-license.php -[18]: https://github.com/exasol/exasol-testcontainers/ -[19]: https://github.com/exasol/exasol-testcontainers/blob/main/LICENSE -[20]: https://java.testcontainers.org -[21]: http://opensource.org/licenses/MIT +[6]: http://hamcrest.org/JavaHamcrest/ +[7]: http://opensource.org/licenses/BSD-3-Clause +[8]: https://junit.org/junit5/ +[9]: https://www.eclipse.org/legal/epl-v20.html +[10]: https://github.com/mockito/mockito +[11]: https://opensource.org/licenses/MIT +[12]: https://www.jqno.nl/equalsverifier +[13]: https://www.apache.org/licenses/LICENSE-2.0.txt +[14]: http://www.slf4j.org +[15]: http://www.opensource.org/licenses/mit-license.php +[16]: https://github.com/exasol/exasol-testcontainers/ +[17]: https://github.com/exasol/exasol-testcontainers/blob/main/LICENSE +[18]: https://java.testcontainers.org +[19]: http://opensource.org/licenses/MIT +[20]: https://www.oracle.com/database/technologies/maven-central-guide.html +[21]: https://www.oracle.com/downloads/licenses/oracle-free-license.html [22]: https://github.com/exasol/test-db-builder-java/ [23]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE [24]: https://github.com/exasol/udf-debugging-java/ diff --git a/doc/changes/changes_2.4.3.md b/doc/changes/changes_2.4.3.md index a5db5ab..11a7076 100644 --- a/doc/changes/changes_2.4.3.md +++ b/doc/changes/changes_2.4.3.md @@ -14,9 +14,14 @@ This release adds integration tests using Exasol 8. ## Dependency Updates +### Compile Dependency Updates + +* Removed `com.oracle.database.jdbc:ojdbc8:23.3.0.23.09` + ### Test Dependency Updates * Updated `com.exasol:hamcrest-resultset-matcher:1.6.1` to `1.6.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` * Updated `org.junit.jupiter:junit-jupiter:5.10.0` to `5.10.1` diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestConstants.java b/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestConstants.java index 116bc84..292b63b 100644 --- a/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestConstants.java +++ b/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestConstants.java @@ -6,7 +6,6 @@ public final class IntegrationTestConstants { public static final String SCHEMA_EXASOL = "SCHEMA_EXASOL"; public static final String TABLE_JOIN_1 = "TABLE_JOIN_1"; public static final String TABLE_JOIN_2 = "TABLE_JOIN_2"; - public static final String JDBC_DRIVER_CONFIGURATION_FILE_NAME = "settings.cfg"; public static final int ORACLE_PORT = 1521; public static final String RESOURCES_FOLDER_DIALECT_NAME = "oracle"; diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestsHelperfunctions.java b/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestsHelperfunctions.java deleted file mode 100644 index 3e4895e..0000000 --- a/src/test/java/com/exasol/adapter/dialects/oracle/IntegrationTestsHelperfunctions.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.exasol.adapter.dialects.oracle; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public class IntegrationTestsHelperfunctions { - public static String getPropertyFromFile(final String resourcesDialectName, final String propertyName) { - final String pathToPropertyFile = getPathToPropertyFile(resourcesDialectName); - try (final InputStream inputStream = new FileInputStream(pathToPropertyFile)) { - final Properties properties = new Properties(); - properties.load(inputStream); - return properties.getProperty(propertyName); - } catch (final IOException exception) { - throw new IllegalArgumentException( - "Cannot access the properties file or read from it. Check if the path spelling is correct" - + " and if the file exists.",exception); - } - } - public static String getPathToPropertyFile(final String resourcesDialectName) { - return "src/test/resources/integration/driver/" + resourcesDialectName + "/" + resourcesDialectName - + ".properties"; - } -} diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/OracleSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/oracle/OracleSqlDialectIT.java index 68d3cb9..77a2a0a 100644 --- a/src/test/java/com/exasol/adapter/dialects/oracle/OracleSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/oracle/OracleSqlDialectIT.java @@ -1,9 +1,7 @@ package com.exasol.adapter.dialects.oracle; import static com.exasol.adapter.dialects.oracle.IntegrationTestConstants.*; -import static com.exasol.adapter.dialects.oracle.IntegrationTestsHelperfunctions.getPropertyFromFile; -import static com.exasol.adapter.dialects.oracle.OracleVirtualSchemaIntegrationTestSetup.createAdapterScript; -import static com.exasol.adapter.dialects.oracle.OracleVirtualSchemaIntegrationTestSetup.uploadOracleJDBCDriverAndVSToBucket; +import static com.exasol.adapter.dialects.oracle.OracleVirtualSchemaIntegrationTestSetup.*; import static com.exasol.matcher.ResultSetMatcher.matchesResultSet; import static com.exasol.matcher.ResultSetStructureMatcher.table; import static org.hamcrest.CoreMatchers.*; @@ -75,8 +73,8 @@ static void beforeAll() private static void uploadInstantClientToBucket() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = exasolContainer.getDefaultBucket(); - final String instantClientName = getPropertyFromFile(RESOURCES_FOLDER_DIALECT_NAME, "instant.client.name"); - final String instantClientPath = getPropertyFromFile(RESOURCES_FOLDER_DIALECT_NAME, "instant.client.path"); + final String instantClientName = "instantclient-basic-linux.x64-12.1.0.2.0.zip"; + final String instantClientPath = "src/test/resources/integration/driver/oracle"; bucket.uploadFile(Path.of(instantClientPath, instantClientName), "drivers/oracle/" + instantClientName); } @@ -91,7 +89,8 @@ private static String getTestHostIpFromInsideExasol(final ExasolContainer exa private static void setupExasolContainer() throws BucketAccessException, TimeoutException, FileNotFoundException, SQLException, InterruptedException { - uploadOracleJDBCDriverAndVSToBucket(exasolContainer.getDefaultBucket()); + uploadOracleJDBCDriverToBucket(exasolContainer); + uploadAdapterToBucket(exasolContainer.getDefaultBucket()); uploadInstantClientToBucket(); final Connection exasolConnection = exasolContainer.createConnectionForUser(exasolContainer.getUsername(), exasolContainer.getPassword()); diff --git a/src/test/java/com/exasol/adapter/dialects/oracle/OracleVirtualSchemaIntegrationTestSetup.java b/src/test/java/com/exasol/adapter/dialects/oracle/OracleVirtualSchemaIntegrationTestSetup.java index d08f192..89dfc4e 100644 --- a/src/test/java/com/exasol/adapter/dialects/oracle/OracleVirtualSchemaIntegrationTestSetup.java +++ b/src/test/java/com/exasol/adapter/dialects/oracle/OracleVirtualSchemaIntegrationTestSetup.java @@ -1,7 +1,6 @@ package com.exasol.adapter.dialects.oracle; -import static com.exasol.adapter.dialects.oracle.IntegrationTestConstants.*; -import static com.exasol.adapter.dialects.oracle.IntegrationTestsHelperfunctions.getPropertyFromFile; +import static com.exasol.adapter.dialects.oracle.IntegrationTestConstants.VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION; import static com.exasol.dbbuilder.dialects.exasol.AdapterScript.Language.JAVA; import java.io.*; @@ -17,6 +16,7 @@ import com.exasol.containers.ExasolService; import com.exasol.dbbuilder.dialects.exasol.*; import com.exasol.dbbuilder.dialects.oracle.OracleObjectFactory; +import com.exasol.drivers.JdbcDriver; import com.exasol.udfdebugging.UdfTestSetup; import com.github.dockerjava.api.model.ContainerNetwork; @@ -28,6 +28,7 @@ public class OracleVirtualSchemaIntegrationTestSetup implements Closeable { private static final String SCHEMA_EXASOL = "SCHEMA_EXASOL"; private static final String ADAPTER_SCRIPT_EXASOL = "ADAPTER_SCRIPT_EXASOL"; private static final String ORACLE_CONTAINER_NAME = IntegrationTestConstants.ORACLE_CONTAINER_NAME; + private static final String ORACLE_JDBC_DRIVER_NAME = "ojdbc8.jar"; private final Statement oracleStatement; private final OracleContainerDBA oracleContainer = new OracleContainerDBA(ORACLE_CONTAINER_NAME); @@ -46,7 +47,8 @@ public class OracleVirtualSchemaIntegrationTestSetup implements Closeable { try { this.exasolContainer.start(); this.oracleContainer.start(); - uploadOracleJDBCDriverAndVSToBucket(this.exasolContainer.getDefaultBucket()); + uploadOracleJDBCDriverToBucket(this.exasolContainer); + uploadAdapterToBucket(this.exasolContainer.getDefaultBucket()); this.exasolConnection = this.exasolContainer.createConnection(""); this.exasolStatement = this.exasolConnection.createStatement(); this.oracleConnection = this.oracleContainer.createConnectionDBA(""); @@ -69,19 +71,16 @@ public class OracleVirtualSchemaIntegrationTestSetup implements Closeable { } } - public static void uploadOracleJDBCDriverAndVSToBucket(final Bucket bucket) + public static void uploadOracleJDBCDriverToBucket(final ExasolContainer> container) throws BucketAccessException, TimeoutException, FileNotFoundException { - final String driverName = getPropertyFromFile(RESOURCES_FOLDER_DIALECT_NAME, "driver.name"); - - final Path pathToSettingsFile = Path.of("src", "test", "resources", "integration", "driver", - RESOURCES_FOLDER_DIALECT_NAME, JDBC_DRIVER_CONFIGURATION_FILE_NAME); + container.getDriverManager() + .install(JdbcDriver.builder("ORACLE").enableSecurityManager(false).mainClass("oracle.jdbc.OracleDriver") + .prefix("jdbc:oracle:thin:") + .sourceFile(Path.of("target/oracle-driver", ORACLE_JDBC_DRIVER_NAME)).build()); + } - // Upload the settings.cfg file for the driver that registers the driver. - bucket.uploadFile(pathToSettingsFile, "drivers/jdbc/" + JDBC_DRIVER_CONFIGURATION_FILE_NAME); - final String driverPath = getPropertyFromFile(RESOURCES_FOLDER_DIALECT_NAME, "driver.path"); - // Upload the driver itself - bucket.uploadFile(Path.of(driverPath, driverName), "drivers/jdbc/" + driverName); - // Upload the virtual schema jar to be able to use oracle virtual schemas + public static void uploadAdapterToBucket(final Bucket bucket) + throws BucketAccessException, TimeoutException, FileNotFoundException { bucket.uploadFile(PATH_TO_VIRTUAL_SCHEMAS_JAR, VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION); } diff --git a/src/test/resources/integration/driver/oracle/oracle.properties b/src/test/resources/integration/driver/oracle/oracle.properties deleted file mode 100644 index 33d273f..0000000 --- a/src/test/resources/integration/driver/oracle/oracle.properties +++ /dev/null @@ -1,4 +0,0 @@ -driver.name=ojdbc8.jar -driver.path=target/oracle-driver -instant.client.name=instantclient-basic-linux.x64-12.1.0.2.0.zip -instant.client.path=src/test/resources/integration/driver/oracle \ No newline at end of file diff --git a/src/test/resources/integration/driver/oracle/settings.cfg b/src/test/resources/integration/driver/oracle/settings.cfg deleted file mode 100644 index dd8870c..0000000 --- a/src/test/resources/integration/driver/oracle/settings.cfg +++ /dev/null @@ -1,7 +0,0 @@ -DRIVERNAME=ORACLE -JAR=ojdbc8.jar -DRIVERMAIN=oracle.jdbc.OracleDriver -PREFIX=jdbc:oracle:thin: -FETCHSIZE=100000 -INSERTSIZE=-1 -NOSECURITY=YES