diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml b/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml index a444e74a9e88c..95ba3e9098605 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml +++ b/integration-tests/opentelemetry-jdbc-instrumentation/pom.xml @@ -326,5 +326,86 @@ + + test-jdbc-instrumentation-docker-oracle + + + start-containers + + + + + + io.fabric8 + docker-maven-plugin + + + + ${oracle.image} + + + 1521:1521 + + + quarkus + + + Oracle Database: + default + red + + + + + + + yes + + + + + + + + true + + + + docker-start + compile + + stop + start + + + + docker-stop + post-integration-test + + stop + + + + + + org.codehaus.mojo + exec-maven-plugin + + + docker-prune + generate-resources + + exec + + + ${docker-prune.location} + + + + + + + diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleLifecycleManager.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleLifecycleManager.java new file mode 100644 index 0000000000000..0bd02392b3c3f --- /dev/null +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleLifecycleManager.java @@ -0,0 +1,30 @@ +package io.quarkus.it.opentelemetry; + +import java.util.HashMap; +import java.util.Map; + +import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; + +public class OracleLifecycleManager implements QuarkusTestResourceLifecycleManager { + + @Override + public Map start() { + Map properties = new HashMap<>(); + properties.put("quarkus.datasource.oracle.jdbc.url", "jdbc:oracle:thin:@localhost:1521/FREEPDB1"); + properties.put("quarkus.datasource.oracle.password", "quarkus"); + properties.put("quarkus.datasource.oracle.username", "SYSTEM"); + properties.put("quarkus.hibernate-orm.oracle.database.generation", "drop-and-create"); + properties.put("quarkus.hibernate-orm.oracle.active", "true"); + properties.put("quarkus.hibernate-orm.mariadb.active", "false"); + properties.put("quarkus.hibernate-orm.postgresql.active", "false"); + properties.put("quarkus.hibernate-orm.db2.active", "false"); + + return properties; + } + + @Override + public void stop() { + // EMPTY + } + +} diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationIT.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationIT.java new file mode 100644 index 0000000000000..e7ccd488acefe --- /dev/null +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationIT.java @@ -0,0 +1,8 @@ +package io.quarkus.it.opentelemetry; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +public class OracleOpenTelemetryJdbcInstrumentationIT extends OracleOpenTelemetryJdbcInstrumentationTest { + +} diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java new file mode 100644 index 0000000000000..67e784bc1d457 --- /dev/null +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java @@ -0,0 +1,17 @@ +package io.quarkus.it.opentelemetry; + +import org.junit.jupiter.api.Test; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(value = OracleLifecycleManager.class, restrictToAnnotatedClass = true) +public class OracleOpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest { + + @Test + void testOracleQueryTraced() { + testQueryTraced("oracle", "OracleHit"); + } + +}