This is an automated email from the ASF dual-hosted git repository.
nfilotto 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 6fded597553 CAMEL-19389: camel-cxf - Upgrade to 4.0.2 (#10221)
6fded597553 is described below
commit 6fded59755302d932883e2f3d063e627dc91a482
Author: Nicolas Filotto <[email protected]>
AuthorDate: Mon Jun 12 17:07:27 2023 +0200
CAMEL-19389: camel-cxf - Upgrade to 4.0.2 (#10221)
## Motivation
A new version of CXF has been released and should be used
## Modifications
* 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 | 4 ++--
components/camel-cxf/camel-cxf-common/pom.xml | 6 ++++++
.../component/cxf/jaxrs/CxfRsProducerHttpMethodHeaderTest.java | 2 +-
.../org/apache/camel/component/cxf/jaxws/CxfProducerRouterTest.java | 2 +-
.../java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java | 6 +++---
.../org/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 | 4 ++--
9 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index 30cc9c9bfc3..54bfe50dec0 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -122,8 +122,8 @@
<corda-version>4.10</corda-version>
<couchbase-client-version>3.4.5</couchbase-client-version>
<curator-version>5.4.0</curator-version>
- <cxf-version>4.0.0</cxf-version>
- <cxf-codegen-plugin-version>4.0.0</cxf-codegen-plugin-version>
+ <cxf-version>4.0.2</cxf-version>
+ <cxf-codegen-plugin-version>4.0.2</cxf-codegen-plugin-version>
<!-- cxf-xjc is not released as often -->
<cxf-xjc-plugin-version>4.0.0</cxf-xjc-plugin-version>
<cxf-xjc-utils-version>4.0.0</cxf-xjc-utils-version>
diff --git a/components/camel-cxf/camel-cxf-common/pom.xml
b/components/camel-cxf/camel-cxf-common/pom.xml
index 29db3647354..59ac759c636 100644
--- a/components/camel-cxf/camel-cxf-common/pom.xml
+++ b/components/camel-cxf/camel-cxf-common/pom.xml
@@ -74,6 +74,12 @@
<version>${jakarta-xml-soap-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 859a3110cb4..86c6a7a1b52 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 a7707519d60..595264d9d9d 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 79c3addc563..1156eee46d3 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 275df0092ce..dd41c4392bf 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 3c39097ace2..fdf92b70dfd 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -117,8 +117,8 @@
<corda-version>4.10</corda-version>
<couchbase-client-version>3.4.5</couchbase-client-version>
<curator-version>5.4.0</curator-version>
- <cxf-version>4.0.0</cxf-version>
- <cxf-codegen-plugin-version>4.0.0</cxf-codegen-plugin-version>
+ <cxf-version>4.0.2</cxf-version>
+ <cxf-codegen-plugin-version>4.0.2</cxf-codegen-plugin-version>
<!-- cxf-xjc is not released as often -->
<cxf-xjc-plugin-version>4.0.0</cxf-xjc-plugin-version>
<cxf-xjc-utils-version>4.0.0</cxf-xjc-utils-version>