This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e68a7ab8cb2 CXF tests - use artemis (#9118)
e68a7ab8cb2 is described below

commit e68a7ab8cb21762a38379d37ed34d13c389c9fb5
Author: Federico Mariani <[email protected]>
AuthorDate: Mon Jan 16 16:07:19 2023 +0100

    CXF tests - use artemis (#9118)
---
 components/camel-cxf/camel-cxf-spring-rest/pom.xml          | 13 -------------
 components/camel-cxf/camel-cxf-spring-soap/pom.xml          | 11 ++++-------
 .../camel/component/cxf/jms/CxfEndpointJMSConsumerTest.java | 13 +++++++++++--
 .../org/apache/camel/component/cxf/jms/camel-context.xml    |  3 ++-
 4 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/components/camel-cxf/camel-cxf-spring-rest/pom.xml 
b/components/camel-cxf/camel-cxf-spring-rest/pom.xml
index 5f5e42444cc..bc3484aa6a6 100644
--- a/components/camel-cxf/camel-cxf-spring-rest/pom.xml
+++ b/components/camel-cxf/camel-cxf-spring-rest/pom.xml
@@ -100,13 +100,6 @@
             <scope>test</scope>
         </dependency>
 
-        <!-- test for the cxf jms transport -->
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-broker</artifactId>
-            <scope>test</scope>
-        </dependency>
-
         <!-- test for cxf failover feature -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -114,12 +107,6 @@
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-kahadb-store</artifactId>
-            <scope>test</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-jms</artifactId>
diff --git a/components/camel-cxf/camel-cxf-spring-soap/pom.xml 
b/components/camel-cxf/camel-cxf-spring-soap/pom.xml
index 5800b29d092..d4d3e340dcc 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/pom.xml
+++ b/components/camel-cxf/camel-cxf-spring-soap/pom.xml
@@ -96,9 +96,11 @@
 
         <!-- test for the cxf jms transport -->
         <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-broker</artifactId>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-artemis</artifactId>
+            <version>${project.version}</version>
             <scope>test</scope>
+            <type>test-jar</type>
         </dependency>
 
         <!-- test for cxf failover feature -->
@@ -108,11 +110,6 @@
             <artifactId>cxf-rt-features-clustering</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-kahadb-store</artifactId>
-            <scope>test</scope>
-        </dependency>
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
diff --git 
a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/jms/CxfEndpointJMSConsumerTest.java
 
b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/jms/CxfEndpointJMSConsumerTest.java
index 067da19f919..d696f840607 100644
--- 
a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/jms/CxfEndpointJMSConsumerTest.java
+++ 
b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/jms/CxfEndpointJMSConsumerTest.java
@@ -19,10 +19,13 @@ package org.apache.camel.component.cxf.jms;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.infra.artemis.services.ArtemisService;
+import org.apache.camel.test.infra.artemis.services.ArtemisServiceFactory;
 import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.hello_world_soap_http.Greeter;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
@@ -30,6 +33,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CxfEndpointJMSConsumerTest extends CamelSpringTestSupport {
 
+    @RegisterExtension
+    private static ArtemisService broker = 
ArtemisServiceFactory.createVMService();
+    static {
+        System.setProperty("CxfEndpointJMSConsumerTest.serviceAddress", 
broker.serviceAddress());
+    }
+
     @Override
     protected AbstractApplicationContext createApplicationContext() {
         return new 
ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jms/camel-context.xml");
@@ -56,9 +65,9 @@ public class CxfEndpointJMSConsumerTest extends 
CamelSpringTestSupport {
         // Here we just the address with JMS URI
         String address = "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue"
                          + "?jndiInitialContextFactory"
-                         + 
"=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+                         + 
"=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"
                          + 
"&jndiConnectionFactoryName=ConnectionFactory&jndiURL="
-                         + "vm://localhost";
+                         + broker.serviceAddress();
 
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setServiceClass(Greeter.class);
diff --git 
a/components/camel-cxf/camel-cxf-spring-soap/src/test/resources/org/apache/camel/component/cxf/jms/camel-context.xml
 
b/components/camel-cxf/camel-cxf-spring-soap/src/test/resources/org/apache/camel/component/cxf/jms/camel-context.xml
index 4a107208880..cd03876d9b1 100644
--- 
a/components/camel-cxf/camel-cxf-spring-soap/src/test/resources/org/apache/camel/component/cxf/jms/camel-context.xml
+++ 
b/components/camel-cxf/camel-cxf-spring-soap/src/test/resources/org/apache/camel/component/cxf/jms/camel-context.xml
@@ -30,9 +30,10 @@ http://cxf.apache.org/transports/jms 
http://cxf.apache.org/schemas/configuration
 
 <bean id="logginOutInterceptor" 
class="org.apache.cxf.ext.logging.LoggingOutInterceptor"/>
 <bean id="logginInInterceptor" 
class="org.apache.cxf.ext.logging.LoggingInInterceptor"/>
+<bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
 <cxf:cxfEndpoint id="jmsEndpoint"
-address="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=vm://localhost"
+address="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=${CxfEndpointJMSConsumerTest.serviceAddress}"
   serviceClass="org.apache.hello_world_soap_http.Greeter"
   endpointName="s:SoapPort"
   serviceName="s:SOAPService"

Reply via email to