You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/06/12 15:08:20 UTC

[camel] branch camel-3.x updated: CAMEL-19390: camel-cxf - Upgrade to 3.6.1 (#10220)

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

nfilotto pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new 64c993398bb CAMEL-19390: camel-cxf - Upgrade to 3.6.1 (#10220)
64c993398bb is described below

commit 64c993398bbaaecf138ebb562e57d365dc85ccd7
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Mon Jun 12 17:08:11 2023 +0200

    CAMEL-19390: camel-cxf - Upgrade to 3.6.1 (#10220)
    
    ## Motivation
    
    Since Apache Camel 3.21 is an LTS version and CXF 3.5 should not be maintained anymore soon as 3.6 and 4.0 have been released, the goal of this task is to upgrade the version of CXF 3.6 and allow OSGI users to choose a higher version of CXF 3 that will remain backward compatible with CXF 3.6.
    
    ## Modications
    
    * Upgrades the versions
    * Adapts the code of some tests to the behavior changes due to the usage internally of the new HTTP client of the JDK that supports HTTP 2.0
---
 camel-dependencies/pom.xml                                         | 7 ++++---
 components/camel-cxf/camel-cxf-common/pom.xml                      | 6 ++++++
 .../component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java     | 2 +-
 .../apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java    | 2 +-
 .../java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java | 6 +++---
 .../apache/camel/component/cxf/CxfMessageHeaderTimeoutTest.java    | 4 ++--
 .../test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java   | 4 ++--
 .../src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java  | 2 +-
 parent/pom.xml                                                     | 7 ++++---
 9 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index ddc8a0deff3..97d2edf8fca 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -137,9 +137,9 @@
         <corda-version>4.9.3</corda-version>
         <couchbase-client-version>3.4.1</couchbase-client-version>
         <curator-version>4.3.0</curator-version>
-        <cxf-version>3.5.5</cxf-version>
-        <cxf-version-range>[3.5,3.6)</cxf-version-range>
-        <cxf-codegen-plugin-version>3.5.5</cxf-codegen-plugin-version>
+        <cxf-version>3.6.1</cxf-version>
+        <cxf-version-range>[3.6,4.0)</cxf-version-range>
+        <cxf-codegen-plugin-version>3.6.1</cxf-codegen-plugin-version>
         <!-- cxf-xjc is not released as often -->
         <cxf-xjc-plugin-version>3.3.2</cxf-xjc-plugin-version>
         <cxf-xjc-utils-version>3.3.2</cxf-xjc-utils-version>
@@ -286,6 +286,7 @@
         <jakarta.el-version>3.0.3</jakarta.el-version>
         <jakarta-inject-version>1.0.5</jakarta-inject-version>
         <jakarta-jaxb-version>2.3.3</jakarta-jaxb-version>
+        <jakarta-xml-soap-api-version>1.4.2</jakarta-xml-soap-api-version>
         <javax-soap-api-version>1.4.0</javax-soap-api-version>
         <jaxws-api-version>2.3.0</jaxws-api-version>
         <glassfish-javax-json>1.0.4</glassfish-javax-json>
diff --git a/components/camel-cxf/camel-cxf-common/pom.xml b/components/camel-cxf/camel-cxf-common/pom.xml
index eca739653ff..d89d415878f 100644
--- a/components/camel-cxf/camel-cxf-common/pom.xml
+++ b/components/camel-cxf/camel-cxf-common/pom.xml
@@ -99,6 +99,12 @@
             <version>${javax-servlet-api-version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>jakarta.xml.soap</groupId>
+            <artifactId>jakarta.xml.soap-api</artifactId>
+            <version>${jakarta-xml-soap-api-version}</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-test-junit5</artifactId>
diff --git a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java
index 77529efa765..7fce8db9c7d 100644
--- a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java
+++ b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java
@@ -59,7 +59,7 @@ public class CxfRsProducerHttpMethodHeaderTest extends CamelTestSupport {
         Response response = (Response) exchange.getMessage().getBody();
 
         // check the response code on the Response object as set by the "HttpProcess"
-        assertEquals(200, response.getStatus());
+        assertEquals(204, response.getStatus());
 
         Exchange e1 = getMockEndpoint("mock:result").getReceivedExchanges().get(0);
         // should not contain CXF headers
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java
index 07187e3dd31..811fe1a8dcc 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java
@@ -81,7 +81,7 @@ public class CxfProducerRouterTest extends CamelTestSupport {
                 from("direct:start")
                         .doTry()
                         .to("cxf://http://localhost:10000/false?serviceClass=org.apache.camel.component.cxf.jaxws.HelloService")
-                        .doCatch(org.apache.cxf.interceptor.Fault.class)
+                        .doCatch(java.net.ConnectException.class)
                         .to("mock:error");
             }
         };
diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
index 70e539a3bde..6b94c14bdfb 100644
--- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
+++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java
@@ -136,17 +136,17 @@ public class CxfProducerTest {
     public void testInvokingAWrongServer() throws Exception {
         Exchange reply = sendSimpleMessage(getWrongEndpointUri());
         assertNotNull(reply.getException(), "We should get the exception here");
-        assertTrue(reply.getException().getCause() instanceof ConnectException);
+        assertTrue(reply.getException() instanceof ConnectException);
 
         //Test the data format PAYLOAD
         reply = sendSimpleMessageWithPayloadMessage(getWrongEndpointUri() + "&dataFormat=PAYLOAD");
         assertNotNull(reply.getException(), "We should get the exception here");
-        assertTrue(reply.getException().getCause() instanceof ConnectException);
+        assertTrue(reply.getException() instanceof ConnectException);
 
         //Test the data format MESSAGE
         reply = sendSimpleMessageWithRawMessage(getWrongEndpointUri() + "&dataFormat=RAW");
         assertNotNull(reply.getException(), "We should get the exception here");
-        assertTrue(reply.getException().getCause() instanceof ConnectException);
+        assertTrue(reply.getException() instanceof ConnectException);
     }
 
     @Test
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfMessageHeaderTimeoutTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfMessageHeaderTimeoutTest.java
index 4d989806534..961535292d2 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfMessageHeaderTimeoutTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfMessageHeaderTimeoutTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.component.cxf;
 
-import java.net.SocketTimeoutException;
+import java.net.http.HttpTimeoutException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -63,7 +63,7 @@ public class CxfMessageHeaderTimeoutTest extends CamelSpringTestSupport {
         Exchange reply = sendJaxWsMessage(endpointUri);
         Exception e = reply.getException();
         assertNotNull(e, "We should get the exception cause here");
-        assertTrue(e instanceof SocketTimeoutException, "We should get the socket time out exception here");
+        assertTrue(e instanceof HttpTimeoutException, "We should get an http time out exception here");
     }
 
     protected Exchange sendJaxWsMessage(String endpointUri) throws InterruptedException {
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
index c87e38fca98..d17daba4b3e 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfTimeoutTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.component.cxf;
 
-import java.net.SocketTimeoutException;
+import java.net.http.HttpTimeoutException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -96,7 +96,7 @@ public class CxfTimeoutTest extends CamelSpringTestSupport {
         Exchange reply = sendJaxWsMessage(endpointUri);
         Exception e = reply.getException();
         assertNotNull(e, "We should get the exception cause here");
-        assertTrue(e instanceof SocketTimeoutException, "We should get the socket time out exception here");
+        assertTrue(e instanceof HttpTimeoutException, "We should get a http time out exception here");
     }
 
     protected Exchange sendJaxWsMessage(String endpointUri) throws InterruptedException {
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java
index 952942ea706..27d22d99e73 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java
@@ -73,7 +73,7 @@ public class SslTest extends CamelSpringTestSupport {
     public void testInvokingNoTrustRoute() throws Exception {
         Exchange reply = sendJaxWsMessage("direct:noTrust");
         assertTrue(reply.isFailed(), "We expect the exception here");
-        Throwable e = reply.getException().getCause();
+        Throwable e = reply.getException();
         assertEquals("javax.net.ssl.SSLHandshakeException", e.getClass().getCanonicalName());
     }
 
diff --git a/parent/pom.xml b/parent/pom.xml
index 919e1502447..da2bad5aa37 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -132,9 +132,9 @@
         <corda-version>4.9.3</corda-version>
         <couchbase-client-version>3.4.1</couchbase-client-version>
         <curator-version>4.3.0</curator-version>
-        <cxf-version>3.5.5</cxf-version>
-        <cxf-version-range>[3.5,3.6)</cxf-version-range>
-        <cxf-codegen-plugin-version>3.5.5</cxf-codegen-plugin-version>
+        <cxf-version>3.6.1</cxf-version>
+        <cxf-version-range>[3.6,4.0)</cxf-version-range>
+        <cxf-codegen-plugin-version>3.6.1</cxf-codegen-plugin-version>
         <!-- cxf-xjc is not released as often -->
         <cxf-xjc-plugin-version>3.3.2</cxf-xjc-plugin-version>
         <cxf-xjc-utils-version>3.3.2</cxf-xjc-utils-version>
@@ -281,6 +281,7 @@
         <jakarta.el-version>3.0.3</jakarta.el-version>
         <jakarta-inject-version>1.0.5</jakarta-inject-version>
         <jakarta-jaxb-version>2.3.3</jakarta-jaxb-version>
+        <jakarta-xml-soap-api-version>1.4.2</jakarta-xml-soap-api-version>
         <javax-soap-api-version>1.4.0</javax-soap-api-version>
         <jaxws-api-version>2.3.0</jaxws-api-version>
         <glassfish-javax-json>1.0.4</glassfish-javax-json>