You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/08/10 06:18:28 UTC
[camel-quarkus] branch main updated: Ref#4772 Introduce group testing for different jdbc db types
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new a3016ad1bb Ref#4772 Introduce group testing for different jdbc db types
a3016ad1bb is described below
commit a3016ad1bb34812c094d397b017aa5a33ed085c0
Author: Lucia Drozdova <ld...@redhat.com>
AuthorDate: Mon Jul 24 10:22:25 2023 +0200
Ref#4772 Introduce group testing for different jdbc db types
---
integration-test-groups/jdbc/db2/pom.xml | 271 ++++++++++++++++++++
.../component/jdbc/db2/Db2JdbcResource.java | 50 ++++
.../quarkus/component/jdbc/db2/Db2JdbcRoutes.java | 69 +++++
.../db2/src/main/resources/application.properties | 24 ++
.../quarkus/component/jdbc/db2/CamelDb2JdbcIT.java | 24 ++
.../component/jdbc/db2/CamelDb2JdbcTest.java | 170 ++++++++++++
.../resources/container-license-acceptance.txt | 2 +
integration-test-groups/jdbc/h2/pom.xml | 271 ++++++++++++++++++++
.../quarkus/component/jdbc/h2/H2JdbcResource.java | 48 ++++
.../quarkus/component/jdbc/h2/H2JdbcRoutes.java | 70 +++++
.../h2/src/main/resources/application.properties | 24 ++
.../quarkus/component/jdbc/h2/CamelH2JdbcIT.java | 24 ++
.../quarkus/component/jdbc/h2/CamelH2JdbcTest.java | 170 ++++++++++++
integration-test-groups/jdbc/mariadb/pom.xml | 271 ++++++++++++++++++++
.../jdbc/mariadb/MariaDbJdbcResource.java | 51 ++++
.../component/jdbc/mariadb/MariaDbJdbcRoutes.java | 70 +++++
.../src/main/resources/application.properties | 25 ++
.../component/jdbc/mariadb/CamelMariaDbJdbcIT.java | 24 ++
.../jdbc/mariadb/CamelMariaDbJdbcTest.java | 169 ++++++++++++
integration-test-groups/jdbc/mssql/pom.xml | 271 ++++++++++++++++++++
.../component/jdbc/mssql/MssqlJdbcResource.java | 51 ++++
.../component/jdbc/mssql/MssqlJdbcRoutes.java | 69 +++++
.../src/main/resources/application.properties | 25 ++
.../component/jdbc/mssql/CamelMssqlJdbcIT.java | 24 ++
.../component/jdbc/mssql/CamelMssqlJdbcTest.java | 169 ++++++++++++
.../resources/container-license-acceptance.txt | 2 +
integration-test-groups/jdbc/mysql/pom.xml | 272 ++++++++++++++++++++
.../component/jdbc/mysql/MysqlJdbcResource.java | 51 ++++
.../component/jdbc/mysql/MysqlJdbcRoutes.java | 70 +++++
.../src/main/resources/application.properties | 25 ++
.../component/jdbc/mysql/CamelMysqlJdbcIT.java | 24 ++
.../component/jdbc/mysql/CamelMysqlJdbcTest.java | 169 ++++++++++++
integration-test-groups/jdbc/oracle/pom.xml | 272 ++++++++++++++++++++
.../component/jdbc/oracle/OracleJdbcResource.java | 50 ++++
.../component/jdbc/oracle/OracleJdbcRoutes.java | 70 +++++
.../src/main/resources/application.properties | 24 ++
.../component/jdbc/oracle/CamelOracleJdbcIT.java | 24 ++
.../component/jdbc/oracle/CamelOracleJdbcTest.java | 169 ++++++++++++
integration-test-groups/{ => jdbc}/pom.xml | 38 ++-
integration-test-groups/jdbc/postgresql/pom.xml | 271 ++++++++++++++++++++
.../jdbc/postgresql/PostgresqlJdbcResource.java | 50 ++++
.../jdbc/postgresql/PostgresqlJdbcRoutes.java | 70 +++++
.../src/main/resources/application.properties | 24 ++
.../jdbc/postgresql/CamelPostgresqlJdbcIT.java | 24 ++
.../jdbc/postgresql/CamelPostgresqlJdbcTest.java | 169 ++++++++++++
integration-test-groups/pom.xml | 1 +
integration-tests-support/jdbc/pom.xml | 102 ++++++++
.../test/support/jdbc/BaseCamelJdbcResource.java | 215 ++++++++++++++++
.../quarkus/test/support/jdbc/model/Camel.java | 42 +++
.../jdbc/src/main/resources/application.properties | 22 ++
.../jdbc/src/main/resources/db2.sql | 20 ++
.../jdbc/src/main/resources/droptables.sql | 20 ++
.../jdbc/src/main/resources/h2.sql | 20 ++
.../jdbc/src/main/resources/inserts.sql | 22 ++
.../jdbc/src/main/resources/mariadb.sql | 20 ++
.../jdbc/src/main/resources/mssql.sql | 20 ++
.../jdbc/src/main/resources/mysql.sql | 20 ++
.../jdbc/src/main/resources/oracle.sql | 20 ++
.../jdbc/src/main/resources/postgresql.sql | 20 ++
integration-tests-support/pom.xml | 1 +
integration-tests/jdbc-grouped/.gitignore | 3 +
integration-tests/jdbc-grouped/pom.xml | 284 +++++++++++++++++++++
integration-tests/pom.xml | 1 +
poms/bom-test/pom.xml | 11 +
tooling/scripts/test-categories.yaml | 1 +
65 files changed, 5146 insertions(+), 23 deletions(-)
diff --git a/integration-test-groups/jdbc/db2/pom.xml b/integration-test-groups/jdbc/db2/pom.xml
new file mode 100644
index 0000000000..03d8fcf0ca
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/pom.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-db2</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC DB2</name>
+ <description>Integration tests for JDBC - DB2 Database</description>
+
+ <properties>
+ <cq.jdbcKind>db2</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-db2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcResource.java b/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcResource.java
new file mode 100644
index 0000000000..d448e7f6ad
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcResource.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.db2;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/db2")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class Db2JdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("db2")
+ AgroalDataSource postgresqlDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "db2";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(postgresqlDataSource, dbKind, context, template);
+ }
+}
diff --git a/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcRoutes.java b/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcRoutes.java
new file mode 100644
index 0000000000..7f98261c88
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/main/java/org/apache/camel/quarkus/component/jdbc/db2/Db2JdbcRoutes.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.db2;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class Db2JdbcRoutes extends RouteBuilder {
+ private String dbKind = "db2";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "SPECIES";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/db2/src/main/resources/application.properties b/integration-test-groups/jdbc/db2/src/main/resources/application.properties
new file mode 100644
index 0000000000..a55643827e
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+quarkus.datasource.db2.db-kind=db2
+quarkus.datasource.db2.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcIT.java b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcIT.java
new file mode 100644
index 0000000000..a0d0096c07
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.db2;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelDb2JdbcIT extends CamelDb2JdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java
new file mode 100644
index 0000000000..9ee03aa7e6
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.db2;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelDb2JdbcTest {
+ String dbKind = "db2";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "ID";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/jdbc/db2/src/test/resources/container-license-acceptance.txt b/integration-test-groups/jdbc/db2/src/test/resources/container-license-acceptance.txt
new file mode 100644
index 0000000000..2561afe5a3
--- /dev/null
+++ b/integration-test-groups/jdbc/db2/src/test/resources/container-license-acceptance.txt
@@ -0,0 +1,2 @@
+docker.io/ibmcom/db2:11.5.7.0a
+mcr.microsoft.com/mssql/server:2019-latest
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/h2/pom.xml b/integration-test-groups/jdbc/h2/pom.xml
new file mode 100644
index 0000000000..6cba23c582
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/pom.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-h2</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC H2</name>
+ <description>Integration tests for JDBC - H2 Database</description>
+
+ <properties>
+ <cq.jdbcKind>h2</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcResource.java b/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcResource.java
new file mode 100644
index 0000000000..b6517a850c
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcResource.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.h2;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/h2")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class H2JdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("h2")
+ AgroalDataSource postgresqlDataSource;
+ @Inject
+ ProducerTemplate template;
+ @Inject
+ CamelContext context;
+ String dbKind = "h2";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(postgresqlDataSource, dbKind, context, template);
+ }
+}
diff --git a/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcRoutes.java b/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcRoutes.java
new file mode 100644
index 0000000000..60c4a924a9
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/src/main/java/org/apache/camel/quarkus/component/jdbc/h2/H2JdbcRoutes.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.h2;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class H2JdbcRoutes extends RouteBuilder {
+
+ private String dbKind = "h2";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "SPECIES";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/h2/src/main/resources/application.properties b/integration-test-groups/jdbc/h2/src/main/resources/application.properties
new file mode 100644
index 0000000000..ce8eb39566
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+quarkus.datasource.h2.db-kind=h2
+quarkus.datasource.h2.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcIT.java b/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcIT.java
new file mode 100644
index 0000000000..c6ef4c8970
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.h2;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelH2JdbcIT extends CamelH2JdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcTest.java b/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcTest.java
new file mode 100644
index 0000000000..a823d0c5fb
--- /dev/null
+++ b/integration-test-groups/jdbc/h2/src/test/java/org/apache/camel/quarkus/component/jdbc/h2/CamelH2JdbcTest.java
@@ -0,0 +1,170 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.h2;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelH2JdbcTest {
+ String dbKind = "h2";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "ID";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/jdbc/mariadb/pom.xml b/integration-test-groups/jdbc/mariadb/pom.xml
new file mode 100644
index 0000000000..54b103717a
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/pom.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-mariadb</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC MariaDB</name>
+ <description>Integration tests for JDBC - MariaDB Database</description>
+
+ <properties>
+ <cq.jdbcKind>mariadb</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mariadb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcResource.java b/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcResource.java
new file mode 100644
index 0000000000..85c8574129
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcResource.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mariadb;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/mariadb")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class MariaDbJdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("mariadb")
+ AgroalDataSource mysqlDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "mariadb";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(mysqlDataSource, dbKind, context, template);
+ }
+
+}
diff --git a/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcRoutes.java b/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcRoutes.java
new file mode 100644
index 0000000000..09fc99413f
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/src/main/java/org/apache/camel/quarkus/component/jdbc/mariadb/MariaDbJdbcRoutes.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mariadb;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class MariaDbJdbcRoutes extends RouteBuilder {
+
+ private String dbKind = "mariadb";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "species";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/mariadb/src/main/resources/application.properties b/integration-test-groups/jdbc/mariadb/src/main/resources/application.properties
new file mode 100644
index 0000000000..f4f5ee3566
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/src/main/resources/application.properties
@@ -0,0 +1,25 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+quarkus.datasource.mariadb.db-kind=mariadb
+quarkus.datasource.mariadb.jdbc.max-size=8
+
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcIT.java b/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcIT.java
new file mode 100644
index 0000000000..7e2be1cac1
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mariadb;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelMariaDbJdbcIT extends CamelMariaDbJdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcTest.java b/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcTest.java
new file mode 100644
index 0000000000..18b866bdc6
--- /dev/null
+++ b/integration-test-groups/jdbc/mariadb/src/test/java/org/apache/camel/quarkus/component/jdbc/mariadb/CamelMariaDbJdbcTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mariadb;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelMariaDbJdbcTest {
+ String dbKind = "mariadb";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "insert_id";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/jdbc/mssql/pom.xml b/integration-test-groups/jdbc/mssql/pom.xml
new file mode 100644
index 0000000000..6433afa33d
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/pom.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-mssql</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC MSSQL</name>
+ <description>Integration tests for JDBC - MSSQL Database</description>
+
+ <properties>
+ <cq.jdbcKind>mssql</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mssql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcResource.java b/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcResource.java
new file mode 100644
index 0000000000..9d1310ea1f
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcResource.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mssql;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/mssql")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class MssqlJdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("mssql")
+ AgroalDataSource mysqlDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "mssql";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(mysqlDataSource, dbKind, context, template);
+ }
+
+}
diff --git a/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcRoutes.java b/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcRoutes.java
new file mode 100644
index 0000000000..ddb3aca7ca
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/main/java/org/apache/camel/quarkus/component/jdbc/mssql/MssqlJdbcRoutes.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mssql;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class MssqlJdbcRoutes extends RouteBuilder {
+ private String dbKind = "mssql";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "species";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/mssql/src/main/resources/application.properties b/integration-test-groups/jdbc/mssql/src/main/resources/application.properties
new file mode 100644
index 0000000000..1945bd0627
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/main/resources/application.properties
@@ -0,0 +1,25 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+
+quarkus.datasource.mssql.db-kind=mssql
+quarkus.datasource.mssql.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcIT.java b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcIT.java
new file mode 100644
index 0000000000..8a6d8fceaf
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mssql;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelMssqlJdbcIT extends CamelMssqlJdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java
new file mode 100644
index 0000000000..97e2b89ba3
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mssql;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelMssqlJdbcTest {
+ String dbKind = "mssql";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "GENERATED_KEYS";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/jdbc/mssql/src/test/resources/container-license-acceptance.txt b/integration-test-groups/jdbc/mssql/src/test/resources/container-license-acceptance.txt
new file mode 100644
index 0000000000..2561afe5a3
--- /dev/null
+++ b/integration-test-groups/jdbc/mssql/src/test/resources/container-license-acceptance.txt
@@ -0,0 +1,2 @@
+docker.io/ibmcom/db2:11.5.7.0a
+mcr.microsoft.com/mssql/server:2019-latest
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mysql/pom.xml b/integration-test-groups/jdbc/mysql/pom.xml
new file mode 100644
index 0000000000..0a50f4c30c
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/pom.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-mysql</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC MySql</name>
+ <description>Integration tests for JDBC - Postgresql Database</description>
+
+ <properties>
+ <cq.jdbcKind>mysql</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mysql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcResource.java b/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcResource.java
new file mode 100644
index 0000000000..a3854a281a
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcResource.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mysql;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/mysql")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class MysqlJdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("mysql")
+ AgroalDataSource mysqlDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "mysql";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(mysqlDataSource, dbKind, context, template);
+ }
+
+}
diff --git a/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcRoutes.java b/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcRoutes.java
new file mode 100644
index 0000000000..fecef9a085
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/src/main/java/org/apache/camel/quarkus/component/jdbc/mysql/MysqlJdbcRoutes.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mysql;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class MysqlJdbcRoutes extends RouteBuilder {
+
+ private String dbKind = "mysql";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "species";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/mysql/src/main/resources/application.properties b/integration-test-groups/jdbc/mysql/src/main/resources/application.properties
new file mode 100644
index 0000000000..0c3aafab07
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/src/main/resources/application.properties
@@ -0,0 +1,25 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+
+quarkus.datasource.mysql.db-kind=mysql
+quarkus.datasource.mysql.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcIT.java b/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcIT.java
new file mode 100644
index 0000000000..519d39ffd6
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mysql;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelMysqlJdbcIT extends CamelMysqlJdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcTest.java b/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcTest.java
new file mode 100644
index 0000000000..0cbfb3a01e
--- /dev/null
+++ b/integration-test-groups/jdbc/mysql/src/test/java/org/apache/camel/quarkus/component/jdbc/mysql/CamelMysqlJdbcTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.mysql;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelMysqlJdbcTest {
+ String dbKind = "mysql";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "GENERATED_KEY";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/jdbc/oracle/pom.xml b/integration-test-groups/jdbc/oracle/pom.xml
new file mode 100644
index 0000000000..5516944add
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/pom.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-oracle</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC Oracle</name>
+ <description>Integration tests for JDBC - Oracle Database</description>
+
+ <properties>
+ <cq.jdbcKind>oracle</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-oracle</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcResource.java b/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcResource.java
new file mode 100644
index 0000000000..b7e38098c2
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcResource.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.oracle;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/oracle")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class OracleJdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("oracle")
+ AgroalDataSource oracleDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "oracle";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(oracleDataSource, dbKind, context, template);
+ }
+}
diff --git a/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcRoutes.java b/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcRoutes.java
new file mode 100644
index 0000000000..9d872b6fb9
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/src/main/java/org/apache/camel/quarkus/component/jdbc/oracle/OracleJdbcRoutes.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.oracle;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class OracleJdbcRoutes extends RouteBuilder {
+
+ private String dbKind = "oracle";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "SPECIES";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/oracle/src/main/resources/application.properties b/integration-test-groups/jdbc/oracle/src/main/resources/application.properties
new file mode 100644
index 0000000000..20e9220ebe
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+quarkus.datasource.oracle.db-kind=oracle
+quarkus.datasource.oracle.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcIT.java b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcIT.java
new file mode 100644
index 0000000000..575df8f166
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.oracle;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelOracleJdbcIT extends CamelOracleJdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java
new file mode 100644
index 0000000000..b9382245d4
--- /dev/null
+++ b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.oracle;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelOracleJdbcTest {
+ String dbKind = "oracle";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "ROWID";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/pom.xml b/integration-test-groups/jdbc/pom.xml
similarity index 51%
copy from integration-test-groups/pom.xml
copy to integration-test-groups/jdbc/pom.xml
index 9141648984..346ed0c005 100644
--- a/integration-test-groups/pom.xml
+++ b/integration-test-groups/jdbc/pom.xml
@@ -17,37 +17,29 @@
limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus</artifactId>
+ <artifactId>camel-quarkus-integration-test-groups</artifactId>
<version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>camel-quarkus-integration-test-groups</artifactId>
+ <artifactId>camel-quarkus-integration-tests-jdbc</artifactId>
<packaging>pom</packaging>
- <name>Camel Quarkus :: Integration Test Groups</name>
-
- <properties>
- <quarkus.banner.enabled>false</quarkus.banner.enabled>
- </properties>
+ <name>Camel Quarkus :: JDBC Tests</name>
<modules>
- <!-- test groups a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat -->
- <module>aws2</module>
- <module>aws2-quarkus-client</module>
- <module>azure</module>
- <module>compression</module>
- <module>cxf-soap</module>
- <module>dataformats-json</module>
- <module>foundation</module>
- <module>http</module>
- <module>mongodb</module>
- <module>xml</module>
+ <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat -->
+ <module>db2</module>
+ <module>h2</module>
+ <module>mariadb</module>
+ <module>mssql</module>
+ <module>mysql</module>
+ <module>oracle</module>
+ <module>postgresql</module>
</modules>
-
-</project>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/postgresql/pom.xml b/integration-test-groups/jdbc/postgresql/pom.xml
new file mode 100644
index 0000000000..a62ff291ed
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/pom.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-jdbc-postgresql</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC Postgresql</name>
+ <description>Integration tests for JDBC - Postgresql Database</description>
+
+ <properties>
+ <cq.jdbcKind>postgresql</cq.jdbcKind>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-postgresql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/main/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/src/test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <quarkus.test.arg-line>-Dcq.jdbcKind=${cq.jdbcKind}</quarkus.test.arg-line>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcResource.java b/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcResource.java
new file mode 100644
index 0000000000..d5ec3c2b09
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcResource.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.postgresql;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.agroal.DataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.annotation.PostConstruct;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.Path;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.test.support.jdbc.BaseCamelJdbcResource;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+
+@Path("/test/postgresql")
+@ApplicationScoped
+@RegisterForReflection(targets = { BaseCamelJdbcResource.class, Camel.class })
+public class PostgresqlJdbcResource extends BaseCamelJdbcResource {
+ @Inject
+ @DataSource("postgresql")
+ AgroalDataSource postgresqlDataSource;
+
+ @Inject
+ ProducerTemplate template;
+
+ @Inject
+ CamelContext context;
+ String dbKind = "postgresql";
+
+ @PostConstruct
+ void postConstruct() throws Exception {
+ super.initialize(postgresqlDataSource, dbKind, context, template);
+ }
+}
diff --git a/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcRoutes.java b/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcRoutes.java
new file mode 100644
index 0000000000..bf4e87ed83
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/src/main/java/org/apache/camel/quarkus/component/jdbc/postgresql/PostgresqlJdbcRoutes.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.postgresql;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+@ApplicationScoped
+public class PostgresqlJdbcRoutes extends RouteBuilder {
+
+ private String dbKind = "postgresql";
+
+ @Override
+ public void configure() {
+ from("direct://get-generated-keys-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ System.out.println(exchange.getIn().getHeaders());
+ Object in = exchange.getIn().getHeader("CamelGeneratedKeysRows");
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://get-headers-" + dbKind)
+ .to("jdbc:" + dbKind)
+ .process(new Processor() {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Object in = exchange.getIn().getHeaders();
+ exchange.getIn().setBody(in);
+ }
+ });
+
+ from("direct://headers-as-parameters-" + dbKind)
+ .to("jdbc:" + dbKind + "?useHeadersAsParameters=true");
+
+ from("timer://interval-polling-" + dbKind + "?delay=2000&repeatCount=1").routeId("jdbc-poll-" + dbKind)
+ .autoStartup(false)
+ .setBody(constant("select * from camelsGenerated order by id desc"))
+ .to("jdbc:" + dbKind)
+ .to("mock:interval-polling-" + dbKind);
+
+ String species = "species";
+
+ from("direct://move-between-datasources-" + dbKind)
+ .setBody(constant("select * from camels"))
+ .to("jdbc:" + dbKind)
+ .split(body())
+ .setBody(simple("insert into camelsProcessed (species) values('${body[" + species + "]}')"))
+ .to("jdbc:" + dbKind);
+ }
+}
diff --git a/integration-test-groups/jdbc/postgresql/src/main/resources/application.properties b/integration-test-groups/jdbc/postgresql/src/main/resources/application.properties
new file mode 100644
index 0000000000..1ce24a6778
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/src/main/resources/application.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+quarkus.datasource.postgresql.db-kind=postgresql
+quarkus.datasource.postgresql.jdbc.max-size=8
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,mssql.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcIT.java b/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcIT.java
new file mode 100644
index 0000000000..7a1a86b0c5
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcIT.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.postgresql;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CamelPostgresqlJdbcIT extends CamelPostgresqlJdbcTest {
+
+}
diff --git a/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcTest.java b/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcTest.java
new file mode 100644
index 0000000000..aa626154e4
--- /dev/null
+++ b/integration-test-groups/jdbc/postgresql/src/test/java/org/apache/camel/quarkus/component/jdbc/postgresql/CamelPostgresqlJdbcTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.jdbc.postgresql;
+
+import java.util.List;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.hamcrest.Matchers.containsStringIgnoringCase;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.wildfly.common.Assert.assertFalse;
+import static org.wildfly.common.Assert.assertNotNull;
+
+@QuarkusTest
+@DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby")
+//https://github.com/quarkusio/quarkus/issues/23083
+public class CamelPostgresqlJdbcTest {
+ String dbKind = "postgresql";
+
+ @Test
+ void testGetSpeciesById() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus dromedarius}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/2").then()
+ .body(equalToIgnoringCase("[{SPECIES=Camelus bactrianus}]"));
+ RestAssured.when().get("/test/" + dbKind + "/species/3").then().body(equalToIgnoringCase("[{SPECIES=Camelus ferus}]"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithResultList() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/list").then().body(is("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testGetSpeciesByIdWithDefinedType() {
+ RestAssured.when().get("/test/" + dbKind + "/species/1/type").then().body(equalToIgnoringCase("Camelus dromedarius 1"));
+ }
+
+ @Test
+ void testExecuteStatement() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select id from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().body(equalToIgnoringCase("[{ID=3}, {ID=2}, {ID=1}]"));
+ }
+
+ @Test
+ void testCamelRetrieveGeneratedKeysHeader() {
+ String idKey = "id";
+
+ List generatedIDs = RestAssured.given()
+ .get("test/" + dbKind + "/generated-keys/rows")
+ .then().extract().body()
+ .jsonPath().getList(idKey);
+
+ assertFalse(generatedIDs.isEmpty());
+ assertNotNull(generatedIDs.get(0));
+ }
+
+ @Test
+ void testHeadersFromInsertOrUpdateQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/insert")
+ .then()
+ .body(containsStringIgnoringCase("CamelGeneratedKeysRowCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcUpdateCount=1"))
+ .and()
+ .body(containsStringIgnoringCase("CamelRetrieveGeneratedKeys=true"))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcColumnNames")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")));
+ }
+
+ @Test
+ void testHeadersFromSelectQuery() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/headers/select")
+ .then()
+ .body(not(containsStringIgnoringCase("CamelGeneratedKeysRowCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcUpdateCount")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelRetrieveGeneratedKeys")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelJdbcParameters")))
+ .and()
+ .body(not(containsStringIgnoringCase("CamelGeneratedColumns")))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcRowCount"))
+ .and()
+ .body(containsStringIgnoringCase("CamelJdbcColumnNames=[ID, SPECIES]"));
+ }
+
+ @Test
+ void testNamedParameters() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters")
+ .then()
+ .body(containsStringIgnoringCase("{ID=1, SPECIES=Camelus dromedarius}"))
+ .and()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testCamelJdbcParametersHeader() {
+ RestAssured.given()
+ .get("test/" + dbKind + "/named-parameters/headers-as-parameters-map")
+ .then()
+ .body(containsStringIgnoringCase("{ID=2, SPECIES=Camelus bactrianus}"));
+ }
+
+ @Test
+ void testTimeIntervalDatabasePolling() {
+ String selectResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsGenerated order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .body(selectResult)
+ .get("/test/" + dbKind + "/interval-polling")
+ .then()
+ .statusCode(204);
+ }
+
+ @Test
+ void testMoveDataBetweenDatasources() {
+ String camelsDbResult = RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camels order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then().extract().body().asString();
+
+ RestAssured.given()
+ .post("test/" + dbKind + "/move-between-datasources");
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).body("select * from camelsProcessed order by id desc")
+ .post("/test/" + dbKind + "/execute")
+ .then()
+ .body(equalTo(camelsDbResult));
+ }
+}
diff --git a/integration-test-groups/pom.xml b/integration-test-groups/pom.xml
index 9141648984..5e263830c5 100644
--- a/integration-test-groups/pom.xml
+++ b/integration-test-groups/pom.xml
@@ -46,6 +46,7 @@
<module>dataformats-json</module>
<module>foundation</module>
<module>http</module>
+ <module>jdbc</module>
<module>mongodb</module>
<module>xml</module>
</modules>
diff --git a/integration-tests-support/jdbc/pom.xml b/integration-tests-support/jdbc/pom.xml
new file mode 100644
index 0000000000..80da6576d2
--- /dev/null
+++ b/integration-tests-support/jdbc/pom.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Support :: JDBC</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/BaseCamelJdbcResource.java b/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/BaseCamelJdbcResource.java
new file mode 100644
index 0000000000..66af09b9c9
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/BaseCamelJdbcResource.java
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test.support.jdbc;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.agroal.api.AgroalDataSource;
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.quarkus.test.support.jdbc.model.Camel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RegisterForReflection
+public class BaseCamelJdbcResource {
+ private static final Logger LOGGER = LoggerFactory.getLogger(BaseCamelJdbcResource.class);
+ ProducerTemplate template;
+
+ CamelContext context;
+ String dbKind;
+
+ public void initialize(AgroalDataSource dataSource, String dbKind, CamelContext context, ProducerTemplate template)
+ throws Exception {
+ Connection conn = dataSource.getConnection();
+ runScripts(conn, "droptables.sql");
+ runScripts(conn, dbKind + ".sql");
+ runScripts(conn, "inserts.sql");
+
+ context.getRouteController().startRoute("jdbc-poll-" + dbKind);
+ this.template = template;
+ this.context = context;
+ this.dbKind = dbKind;
+ }
+
+ @Path("/species/{id}")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getSpeciesById(@PathParam("id") String id) throws Exception {
+ return template.requestBody("jdbc:" + dbKind, "select species from camels where id = " + id, String.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Path("/species/{id}/list")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getSpeciesByIdWithSelectList(@PathParam("id") String id) throws Exception {
+ List<LinkedHashMap<String, Object>> result = template
+ .requestBody("jdbc:" + dbKind + "?outputType=SelectList", "select * from camels where id = " + id, List.class);
+
+ if (result.isEmpty()) {
+ throw new IllegalStateException("Expected at least 1 camel result but none were found");
+ }
+
+ LinkedHashMap<String, Object> data = result.get(0);
+ return data.get(getSpeciesRowName()) + " " + data.get(getIdRowName());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Path("/species/{id}/type")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getSpeciesByIdWithDefinedType(@PathParam("id") String id) throws Exception {
+ List<Camel> results = template.requestBody("jdbc:" + dbKind + "?outputClass=" + Camel.class.getName(),
+ "select * from camels where id = " + id, List.class);
+
+ if (results.isEmpty()) {
+ throw new IllegalStateException("Expected at least 1 camel result but none were found");
+ }
+
+ Camel camel = results.get(0);
+ return camel.getSpecies() + " " + camel.getId();
+ }
+
+ @Path("/execute")
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String executeStatement(String statement) throws Exception {
+ return template.requestBody("jdbc:" + dbKind, statement, String.class);
+ }
+
+ @Path("/generated-keys/rows")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public List generatedKeysRows() throws Exception {
+ return template.requestBodyAndHeader("direct://get-generated-keys-" + dbKind,
+ "insert into camelsGenerated (species) values ('Camelus testus')",
+ "CamelRetrieveGeneratedKeys", "true", ArrayList.class);
+ }
+
+ @Path("/headers/insert")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String headersFromInsertOrUpdate() throws Exception {
+ return template.requestBodyAndHeader("direct://get-headers-" + dbKind,
+ "insert into camelsGenerated (species) values ('Camelus testus')",
+ "CamelRetrieveGeneratedKeys", "true", String.class);
+ }
+
+ @Path("/headers/select")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String headersFromSelect() throws Exception {
+ return template.requestBody("direct://get-headers-" + dbKind, "select * from camelsGenerated", String.class);
+ }
+
+ @Path("/named-parameters/headers-as-parameters")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String headersAsParameters() throws Exception {
+ int id = 3;
+ return template.requestBodyAndHeader("direct://headers-as-parameters-" + dbKind,
+ "select * from camels where id < :?idmax order by id",
+ "idmax", id, String.class);
+ }
+
+ @Path("/named-parameters/headers-as-parameters-map")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String headersAsParametersMap() throws Exception {
+ Map<String, Object> headersMap = Map.of("idmax", 3, "specs", "Camelus bactrianus");
+ return template.requestBodyAndHeader("direct://headers-as-parameters-" + dbKind,
+ "select * from camels where id < :?idmax and species = :?specs order by id",
+ "CamelJdbcParameters", headersMap, String.class);
+ }
+
+ @Path("/interval-polling")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public void intervalPolling(String selectResult) throws Exception {
+ MockEndpoint mockEndpoint = context.getEndpoint("mock:interval-polling-" + dbKind, MockEndpoint.class);
+ mockEndpoint.expectedBodiesReceived(selectResult);
+
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Path("/move-between-datasources")
+ @POST
+ @Produces(MediaType.APPLICATION_JSON)
+ public String moveBetweenDatasources() throws Exception {
+ return template.requestBody("direct://move-between-datasources-" + dbKind, null, String.class);
+ }
+
+ private void runScripts(Connection conn, String fileName) throws SQLException, IOException {
+ try (Statement statement = conn.createStatement()) {
+ try (InputStream is = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream(fileName);
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader reader = new BufferedReader(isr)) {
+
+ //execute each line from the sql script as separate statement
+ reader.lines().filter(s -> s != null && !"".equals(s) && !s.startsWith("--")).forEach(s -> {
+ try {
+ statement.execute(s);
+ } catch (SQLException e) {
+ if (!s.toUpperCase().startsWith("DROP")) {
+ throw new RuntimeException(e);
+ } else {
+ LOGGER.debug(String.format("Command '%s' failed.", s)); //use debug logging
+ }
+ }
+ });
+ }
+ }
+ }
+
+ private String getIdRowName() {
+ if (dbKind.equals("h2") || dbKind.equals("oracle") || dbKind.equals("db2")) {
+ return "ID";
+ } else {
+ return "id";
+ }
+ }
+
+ private String getSpeciesRowName() {
+ if (dbKind.equals("h2") || dbKind.equals("oracle") || dbKind.equals("db2")) {
+ return "SPECIES";
+ } else {
+ return "species";
+ }
+ }
+}
diff --git a/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/model/Camel.java b/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/model/Camel.java
new file mode 100644
index 0000000000..ad81657782
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/java/org/apache/camel/quarkus/test/support/jdbc/model/Camel.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.test.support.jdbc.model;
+
+import io.quarkus.runtime.annotations.RegisterForReflection;
+
+@RegisterForReflection
+public class Camel {
+
+ private int id;
+ private String species;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(String species) {
+ this.species = species;
+ }
+}
diff --git a/integration-tests-support/jdbc/src/main/resources/application.properties b/integration-tests-support/jdbc/src/main/resources/application.properties
new file mode 100644
index 0000000000..9c07edacc5
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/application.properties
@@ -0,0 +1,22 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus :: DS
+#
+
+quarkus.native.resources.includes=postgresql.sql,mysql.sql,mariadb.sql,oracle.sql,h2.sql,db2.sql,inserts.sql,droptables.sql
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/db2.sql b/integration-tests-support/jdbc/src/main/resources/db2.sql
new file mode 100644
index 0000000000..48e78bc85f
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/db2.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+CREATE TABLE camels (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, species VARCHAR(50) NOT NULL,PRIMARY KEY (id))
+CREATE TABLE camelsGenerated (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, species VARCHAR(50) NOT NULL,PRIMARY KEY (id))
+CREATE TABLE camelsProcessed (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, species VARCHAR(50) NOT NULL,PRIMARY KEY (id))
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/droptables.sql b/integration-tests-support/jdbc/src/main/resources/droptables.sql
new file mode 100644
index 0000000000..7a77034cc8
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/droptables.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+drop table camels
+drop table camelsGenerated
+drop table camelsProcessed
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/h2.sql b/integration-tests-support/jdbc/src/main/resources/h2.sql
new file mode 100644
index 0000000000..e54ab07edd
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/h2.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+create table camels (id int auto_increment primary key, species varchar(50))
+create table camelsGenerated (id int auto_increment primary key, species varchar(50))
+create table camelsProcessed (id int auto_increment primary key , species varchar(50))
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/inserts.sql b/integration-tests-support/jdbc/src/main/resources/inserts.sql
new file mode 100644
index 0000000000..fce3a151ca
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/inserts.sql
@@ -0,0 +1,22 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+insert into camelsGenerated (species) values ('Camelus status')
+insert into camelsGenerated (species) values ('Camelus linus')
+insert into camels (species) values ('Camelus dromedarius')
+insert into camels (species) values ('Camelus bactrianus')
+insert into camels (species) values ('Camelus ferus')
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/mariadb.sql b/integration-tests-support/jdbc/src/main/resources/mariadb.sql
new file mode 100644
index 0000000000..e54ab07edd
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/mariadb.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+create table camels (id int auto_increment primary key, species varchar(50))
+create table camelsGenerated (id int auto_increment primary key, species varchar(50))
+create table camelsProcessed (id int auto_increment primary key , species varchar(50))
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/mssql.sql b/integration-tests-support/jdbc/src/main/resources/mssql.sql
new file mode 100644
index 0000000000..c603f48434
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/mssql.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+create table camels (id int IDENTITY(1,1) PRIMARY KEY, species varchar(255))
+create table camelsGenerated (id int IDENTITY(1,1) PRIMARY KEY, species varchar(255))
+create table camelsProcessed (id int IDENTITY(1,1) PRIMARY KEY, species varchar(255))
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/mysql.sql b/integration-tests-support/jdbc/src/main/resources/mysql.sql
new file mode 100644
index 0000000000..e54ab07edd
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/mysql.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+create table camels (id int auto_increment primary key, species varchar(50))
+create table camelsGenerated (id int auto_increment primary key, species varchar(50))
+create table camelsProcessed (id int auto_increment primary key , species varchar(50))
\ No newline at end of file
diff --git a/integration-tests-support/jdbc/src/main/resources/oracle.sql b/integration-tests-support/jdbc/src/main/resources/oracle.sql
new file mode 100644
index 0000000000..a127ab480b
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/oracle.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+CREATE TABLE camels(id NUMBER GENERATED by default on null as IDENTITY, species VARCHAR2(50) NOT NULL, PRIMARY KEY(id))
+CREATE TABLE camelsGenerated(id NUMBER GENERATED by default on null as IDENTITY, species VARCHAR2(50) NOT NULL, PRIMARY KEY(id))
+CREATE TABLE camelsProcessed(id NUMBER GENERATED by default on null as IDENTITY, species VARCHAR2(50) NOT NULL, PRIMARY KEY(id))
diff --git a/integration-tests-support/jdbc/src/main/resources/postgresql.sql b/integration-tests-support/jdbc/src/main/resources/postgresql.sql
new file mode 100644
index 0000000000..b31dc12ef6
--- /dev/null
+++ b/integration-tests-support/jdbc/src/main/resources/postgresql.sql
@@ -0,0 +1,20 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+CREATE TABLE camels (id serial PRIMARY KEY, species VARCHAR ( 50 ) NOT NULL)
+CREATE TABLE camelsGenerated (id serial PRIMARY KEY, species VARCHAR ( 50 ) NOT NULL)
+CREATE TABLE camelsProcessed (id serial PRIMARY KEY, species VARCHAR ( 50 ) NOT NULL)
\ No newline at end of file
diff --git a/integration-tests-support/pom.xml b/integration-tests-support/pom.xml
index 64eac71d0d..84ebb6b244 100644
--- a/integration-tests-support/pom.xml
+++ b/integration-tests-support/pom.xml
@@ -45,6 +45,7 @@
<module>custom-type-converter</module>
<module>custom-main-listener</module>
<module>google</module>
+ <module>jdbc</module>
<module>kafka</module>
<module>mongodb</module>
<module>process-executor-support</module>
diff --git a/integration-tests/jdbc-grouped/.gitignore b/integration-tests/jdbc-grouped/.gitignore
new file mode 100644
index 0000000000..6119608b19
--- /dev/null
+++ b/integration-tests/jdbc-grouped/.gitignore
@@ -0,0 +1,3 @@
+
+# src/main and src/test are copied from the underlying isolated modules by group-tests.groovy
+/src/
diff --git a/integration-tests/jdbc-grouped/pom.xml b/integration-tests/jdbc-grouped/pom.xml
new file mode 100644
index 0000000000..71724765a9
--- /dev/null
+++ b/integration-tests/jdbc-grouped/pom.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-jdbc-grouped</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: JDBC Grouped</name>
+ <description>JDBC tests from ../integration-test-groups/jdbc merged together</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-db2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mariadb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mssql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-mysql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-oracle</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jdbc-postgresql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>group-sources</id>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <scripts>
+ <script>file:${maven.multiModuleProjectDirectory}/tooling/scripts/group-tests.groovy</script>
+ </scripts>
+ <properties>
+ <group-tests.source.dir>${maven.multiModuleProjectDirectory}/integration-test-groups/jdbc</group-tests.source.dir>
+ <group-tests.dest.module.dir>${project.basedir}</group-tests.dest.module.dir>
+ <group-tests.concat.rel.paths>src/main/resources/application.properties</group-tests.concat.rel.paths>
+ </properties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-jdbc-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-mock-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 34a4ae4fed..dca860b76e 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -121,6 +121,7 @@
<module>jaxb</module>
<module>jcache</module>
<module>jdbc</module>
+ <module>jdbc-grouped</module>
<module>jfr</module>
<module>jira</module>
<module>jms-artemis-client</module>
diff --git a/poms/bom-test/pom.xml b/poms/bom-test/pom.xml
index 2bf18b2591..077be210a4 100644
--- a/poms/bom-test/pom.xml
+++ b/poms/bom-test/pom.xml
@@ -129,6 +129,17 @@
<artifactId>camel-quarkus-integration-tests-support-azure</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests-support-jdbc</artifactId>
+ <version>${camel-quarkus.version}</version>
+ <type>test-jar</type>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-tests-support-kafka</artifactId>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index a14f32a974..5760b9fd0f 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -39,6 +39,7 @@ group-02:
- jackson-avro
- jackson-protobuf
- jfr
+ - jdbc-grouped
- kafka-oauth
- oaipmh
- pubnub