This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
The following commit(s) were added to refs/heads/camel-quarkus-main by this
push:
new 1c19e80 Replace quarkus-test-artemis with dev services container
1c19e80 is described below
commit 1c19e80ac5b80dd5437b25ba6849b03f8c8f9fe0
Author: James Netherton <[email protected]>
AuthorDate: Mon Sep 2 09:48:18 2024 +0100
Replace quarkus-test-artemis with dev services container
---
jms-jpa/pom.xml | 16 +++++---
jms-jpa/src/main/resources/application.properties | 1 -
jms-jpa/src/test/java/org/acme/JtaTest.java | 2 -
jms-jpa/src/test/resources/broker.xml | 44 ----------------------
message-bridge/pom.xml | 6 ---
.../java/org/acme/message/bridge/Producers.java | 2 +-
.../src/main/resources/application.properties | 11 +++---
.../acme/message/bridge/MessageBridgeITCase.java | 2 -
message-bridge/src/test/resources/broker.xml | 41 --------------------
9 files changed, 18 insertions(+), 107 deletions(-)
diff --git a/jms-jpa/pom.xml b/jms-jpa/pom.xml
index 16a0c58..7062711 100644
--- a/jms-jpa/pom.xml
+++ b/jms-jpa/pom.xml
@@ -136,11 +136,6 @@
<artifactId>quarkus-test-h2</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>io.quarkiverse.artemis</groupId>
- <artifactId>quarkus-test-artemis</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
@@ -316,5 +311,16 @@
<quarkus.native.enabled>true</quarkus.native.enabled>
</properties>
</profile>
+ <profile>
+ <id>skip-testcontainers-tests</id>
+ <activation>
+ <property>
+ <name>skip-testcontainers-tests</name>
+ </property>
+ </activation>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/jms-jpa/src/main/resources/application.properties
b/jms-jpa/src/main/resources/application.properties
index 20974c3..013bcae 100644
--- a/jms-jpa/src/main/resources/application.properties
+++ b/jms-jpa/src/main/resources/application.properties
@@ -45,7 +45,6 @@ camel.rest.context-path=/api
# Quarkus Artemis
quarkus.artemis.enabled=true
-%test.quarkus.artemis.devservices.enabled=false
#%prod.quarkus.artemis.url=tcp://localhost:61616
#%prod.quarkus.artemis.username=admin
#%prod.quarkus.artemis.password=admin
diff --git a/jms-jpa/src/test/java/org/acme/JtaTest.java
b/jms-jpa/src/test/java/org/acme/JtaTest.java
index 9cea4d6..d934790 100644
--- a/jms-jpa/src/test/java/org/acme/JtaTest.java
+++ b/jms-jpa/src/test/java/org/acme/JtaTest.java
@@ -19,7 +19,6 @@ package org.acme;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
-import io.quarkus.artemis.test.ArtemisTestResource;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.h2.H2DatabaseTestResource;
import io.quarkus.test.junit.QuarkusTest;
@@ -31,7 +30,6 @@ import static org.hamcrest.Matchers.is;
@QuarkusTest
@WithTestResource(H2DatabaseTestResource.class)
-@WithTestResource(ArtemisTestResource.class)
public class JtaTest {
@Test
public void testXA() {
diff --git a/jms-jpa/src/test/resources/broker.xml
b/jms-jpa/src/test/resources/broker.xml
deleted file mode 100644
index 274a4dd..0000000
--- a/jms-jpa/src/test/resources/broker.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<!--
-
- 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.
-
--->
-<configuration xmlns="urn:activemq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
- <core xmlns="urn:activemq:core">
- <paging-directory>./target/artemis/paging</paging-directory>
- <bindings-directory>./target/artemis/bindings</bindings-directory>
- <journal-directory>./target/artemis/journal</journal-directory>
-
<large-messages-directory>./target/artemis/large-messages</large-messages-directory>
-
- <connectors>
- <connector name="activemq">tcp://localhost:61617</connector>
- </connectors>
- <acceptors>
- <acceptor name="activemq">tcp://localhost:61617</acceptor>
- </acceptors>
-
- <max-disk-usage>-1</max-disk-usage>
- <security-enabled>false</security-enabled>
-
- <addresses>
- <address name="outbound">
- <anycast>
- <queue name="outbound"/>
- </anycast>
- </address>
- </addresses>
- </core>
-</configuration>
diff --git a/message-bridge/pom.xml b/message-bridge/pom.xml
index 010f953..0818217 100644
--- a/message-bridge/pom.xml
+++ b/message-bridge/pom.xml
@@ -124,12 +124,6 @@
<artifactId>camel-quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>io.quarkiverse.artemis</groupId>
- <artifactId>quarkus-test-artemis</artifactId>
- <version>${quarkus-artemis-jms.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
diff --git
a/message-bridge/src/main/java/org/acme/message/bridge/Producers.java
b/message-bridge/src/main/java/org/acme/message/bridge/Producers.java
index f9e51a3..b48db87 100644
--- a/message-bridge/src/main/java/org/acme/message/bridge/Producers.java
+++ b/message-bridge/src/main/java/org/acme/message/bridge/Producers.java
@@ -90,7 +90,7 @@ public class Producers {
* @return a new JmsComponent instance
*/
@Identifier("amq")
- JmsComponent amq(@Identifier("amqConnectionFactory") ConnectionFactory cf,
JtaTransactionManager tm) {
+ JmsComponent amq(ConnectionFactory cf, JtaTransactionManager tm) {
JmsComponent amq = new JmsComponent();
amq.setConnectionFactory(cf);
amq.setTransactionManager(tm);
diff --git a/message-bridge/src/main/resources/application.properties
b/message-bridge/src/main/resources/application.properties
index a93adfa..f2d6429 100644
--- a/message-bridge/src/main/resources/application.properties
+++ b/message-bridge/src/main/resources/application.properties
@@ -26,11 +26,12 @@ ibm.mq.user=app
ibm.mq.password=passw0rd
ibm.mq.queue=DEV.QUEUE.1
-quarkus.artemis.amqConnectionFactory.url=tcp://localhost:61616
-%kubernetes.quarkus.artemis.amqConnectionFactory.url=tcp://${ACTIVEMQ_SERVICE_HOST}:61616
-%openshift.quarkus.artemis.amqConnectionFactory.url=tcp://activemq-artemis-broker:61616
-quarkus.artemis.amqConnectionFactory.username=admin
-quarkus.artemis.amqConnectionFactory.password=admin
+quarkus.artemis.devservices.enabled=true
+%prod.quarkus.artemis.url=tcp://localhost:61616
+%prod.quarkus.artemis.username=admin
+%prod.quarkus.artemis.password=admin
+%kubernetes.quarkus.artemis.url=tcp://${ACTIVEMQ_SERVICE_HOST}:61616
+%openshift.quarkus.artemis.url=tcp://activemq-artemis-broker:61616
amq.queue=in
quarkus.pooled-jms.transaction=xa
diff --git
a/message-bridge/src/test/java/org/acme/message/bridge/MessageBridgeITCase.java
b/message-bridge/src/test/java/org/acme/message/bridge/MessageBridgeITCase.java
index aacf5a8..909fc53 100644
---
a/message-bridge/src/test/java/org/acme/message/bridge/MessageBridgeITCase.java
+++
b/message-bridge/src/test/java/org/acme/message/bridge/MessageBridgeITCase.java
@@ -21,7 +21,6 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;
-import io.quarkus.artemis.test.ArtemisTestResource;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.restassured.RestAssured;
@@ -37,7 +36,6 @@ import org.junit.jupiter.api.TestMethodOrder;
import static org.assertj.core.api.Assertions.assertThat;
@QuarkusIntegrationTest
-@WithTestResource(ArtemisTestResource.class)
@WithTestResource(IBMMQTestResource.class)
// The crash test will kill the app, so it must be executed last as there is
no way to restart the application
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
diff --git a/message-bridge/src/test/resources/broker.xml
b/message-bridge/src/test/resources/broker.xml
deleted file mode 100644
index d7b98e4..0000000
--- a/message-bridge/src/test/resources/broker.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-
- 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.
-
--->
-<configuration xmlns="urn:activemq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:activemq
../../../../src/schema/artemis-configuration.xsd">
- <core xmlns="urn:activemq:core">
-
- <bindings-directory>./target/messaging/bindings</bindings-directory>
- <journal-directory>./target/messaging/journal</journal-directory>
-
<large-messages-directory>./target/messaging/largemessages</large-messages-directory>
- <paging-directory>./target/messaging/paging</paging-directory>
-
- <security-enabled>false</security-enabled>
-
- <acceptors>
- <acceptor name="tcp">tcp://localhost:61616</acceptor>
- </acceptors>
-
- <addresses>
- <address name="in">
- <anycast>
- <queue name="in"/>
- </anycast>
- </address>
- </addresses>
- </core>
-</configuration>