(camel-spring-boot-examples) branch main updated: [CAMEL-20683]use spring-boot-starter-undertow as the embedded servlet server and demonstrate how to configure undertow handlers
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new aa7c0c5 [CAMEL-20683]use spring-boot-starter-undertow as the embedded servlet server and demonstrate how to configure undertow handlers aa7c0c5 is described below commit aa7c0c5f92e73a0aeb5b63b15a110c894c3e91dd Author: Freeman Fang AuthorDate: Tue Apr 16 10:41:35 2024 -0400 [CAMEL-20683]use spring-boot-starter-undertow as the embedded servlet server and demonstrate how to configure undertow handlers --- soap-cxf/pom.xml | 12 - .../java/sample/camel/UndertowConfiguration.java | 53 ++ .../src/test/java/sample/camel/WsdlClientTest.java | 42 + 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/soap-cxf/pom.xml b/soap-cxf/pom.xml index 188a4b0..37659c9 100644 --- a/soap-cxf/pom.xml +++ b/soap-cxf/pom.xml @@ -65,13 +65,23 @@ - org.apache.camel.springboot + org.apache.camel.springboot camel-spring-boot-starter org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + +org.springframework.boot +spring-boot-starter-undertow + org.springframework.boot spring-boot-starter-actuator diff --git a/soap-cxf/src/main/java/sample/camel/UndertowConfiguration.java b/soap-cxf/src/main/java/sample/camel/UndertowConfiguration.java new file mode 100644 index 000..0da059e --- /dev/null +++ b/soap-cxf/src/main/java/sample/camel/UndertowConfiguration.java @@ -0,0 +1,53 @@ +/* + * 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 sample.camel; + + + +import org.springframework.boot.web.embedded.undertow.UndertowDeploymentInfoCustomizer; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; + +import org.springframework.stereotype.Component; + +import io.undertow.server.HandlerWrapper; +import io.undertow.server.HttpHandler; +import io.undertow.server.handlers.RequestLimitingHandler; +import io.undertow.servlet.api.DeploymentInfo; + +@Component +public class UndertowConfiguration implements WebServerFactoryCustomizer { +@Override +public void customize(UndertowServletWebServerFactory factory) { +factory.addDeploymentInfoCustomizers(new UndertowDeploymentInfoCustomizer() { +@Override +public void customize(DeploymentInfo deploymentInfo) { +// Enable RequestLimitingHandler +// we actually can configure all applicable undertow handlers here +deploymentInfo.addOuterHandlerChainWrapper(new HandlerWrapper() { +@Override +public HttpHandler wrap(HttpHandler handler) { + +return new RequestLimitingHandler(1, 1, handler); +} +}); +} +}); + + +} +} diff --git a/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java b/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java index e27dcda..f234ca1 100644 --- a/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java +++ b/soap-cxf/src/test/java/sample/camel/WsdlClientTest.java @@ -18,8 +18,10 @@ package sample.camel; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.a
(camel) branch main updated (d59aa528d11 -> c2f71910961)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/camel.git from d59aa528d11 cxf 4.0.4 plugin do not work, going back to 4.0.3 add c2f71910961 make jaxb binding file compliant with JEE9+ spec(CXF version upgrade) No new revisions were added by this update. Summary of changes: tests/camel-itest/src/test/resources/wsdl/binding.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[camel-spring-boot] 02/02: fix another camel-cxf broken test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.21.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit ea1db167ee6942b6df4ea3f0a22131ede58d8075 Author: Freeman Fang AuthorDate: Fri Oct 20 11:05:47 2023 -0400 fix another camel-cxf broken test --- .../org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java index c7d894d606f..97f422d4ea3 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java @@ -97,7 +97,7 @@ public class SslTest { 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()); }
[camel-spring-boot] 01/02: fix broken camel-cxf test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.21.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit b6a9c014a49d742851a0e51915b6ba84a8e7de0e Author: Freeman Fang AuthorDate: Fri Oct 20 10:54:06 2023 -0400 fix broken camel-cxf test (cherry picked from commit 5f62899a4f4e947cc5adb81ed56dcbc2851a0c5d) --- .../apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java | 4 ++-- .../component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java| 4 ++-- .../apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java| 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java index 6e6b0bd4183..4a3fedf5488 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.List; @@ -131,7 +131,7 @@ public class CxfBeanScopeTest { 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 the time out exception here"); } @Autowired diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java index 27dded0c7ae..3cbc16ff563 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java @@ -19,7 +19,7 @@ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -108,7 +108,7 @@ public class CxfMessageHeaderTimeoutTest { 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 the time out exception here"); } protected Exchange sendJaxWsMessage(String endpointUri) throws InterruptedException { diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java index 80663f9ac65..9d8641cc266 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.List; @@ -124,7 +124,7 @@ public class CxfTimeoutTest { 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 the time out exception here"); } @Autowired
[camel-spring-boot] branch camel-spring-boot-3.21.x updated (7e8b1dc27a2 -> ea1db167ee6)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch camel-spring-boot-3.21.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git from 7e8b1dc27a2 Upgrade to spring-boot 2.7.17 (#977) new b6a9c014a49 fix broken camel-cxf test new ea1db167ee6 fix another camel-cxf broken test The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java | 4 ++-- .../component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java| 4 ++-- .../apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java| 4 ++-- .../org/apache/camel/component/cxf/soap/springboot/ssl/SslTest.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
[camel-spring-boot] branch camel-spring-boot-3.x updated: fix broken camel-cxf test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.x by this push: new 5f62899a4f4 fix broken camel-cxf test 5f62899a4f4 is described below commit 5f62899a4f4e947cc5adb81ed56dcbc2851a0c5d Author: Freeman Fang AuthorDate: Fri Oct 20 10:54:06 2023 -0400 fix broken camel-cxf test --- .../apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java | 4 ++-- .../component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java| 4 ++-- .../apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java| 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java index 6e6b0bd4183..4a3fedf5488 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.List; @@ -131,7 +131,7 @@ public class CxfBeanScopeTest { 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 the time out exception here"); } @Autowired diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java index 27dded0c7ae..3cbc16ff563 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfMessageHeaderTimeoutTest.java @@ -19,7 +19,7 @@ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -108,7 +108,7 @@ public class CxfMessageHeaderTimeoutTest { 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 the time out exception here"); } protected Exchange sendJaxWsMessage(String endpointUri) throws InterruptedException { diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java index 80663f9ac65..9d8641cc266 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.cxf.soap.springboot; -import java.net.SocketTimeoutException; +import java.net.http.HttpTimeoutException; import java.util.ArrayList; import java.util.List; @@ -124,7 +124,7 @@ public class CxfTimeoutTest { 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 the time out exception here"); } @Autowired
[camel] branch camel-4.0.x updated: [CAMEL-19935]upgrade to CXF 4.0.3
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-4.0.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-4.0.x by this push: new db8f65b8350 [CAMEL-19935]upgrade to CXF 4.0.3 db8f65b8350 is described below commit db8f65b83503c3a81ddbd60457548b7acf4d586f Author: Freeman Fang AuthorDate: Tue Oct 3 16:10:56 2023 -0400 [CAMEL-19935]upgrade to CXF 4.0.3 (cherry picked from commit 49eda4f5a402f6865260984c62f7c5b732ed5004) --- .../java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java | 6 +++--- .../src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java | 2 +- parent/pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 33af8e8dbfd..6fed84b0eea 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() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); //Test the data format PAYLOAD reply = sendSimpleMessageWithPayloadMessage(getWrongEndpointUri() + "&dataFormat=PAYLOAD"); assertNotNull(reply.getException(), "We should get the exception here"); -assertTrue(reply.getException() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); //Test the data format MESSAGE reply = sendSimpleMessageWithRawMessage(getWrongEndpointUri() + "&dataFormat=RAW"); assertNotNull(reply.getException(), "We should get the exception here"); -assertTrue(reply.getException() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); } @Test 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 27d22d99e73..952942ea706 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(); +Throwable e = reply.getException().getCause(); assertEquals("javax.net.ssl.SSLHandshakeException", e.getClass().getCanonicalName()); } diff --git a/parent/pom.xml b/parent/pom.xml index 907f8366ec4..239ad3a1981 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -115,8 +115,8 @@ 2.7 3.4.9 5.5.0 -4.0.2 -4.0.2 +4.0.3 +4.0.3 4.0.0 4.0.0
[camel] branch main updated: [CAMEL-19935]upgrade to CXF 4.0.3
This is an automated email from the ASF dual-hosted git repository. ffang 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 49eda4f5a40 [CAMEL-19935]upgrade to CXF 4.0.3 49eda4f5a40 is described below commit 49eda4f5a402f6865260984c62f7c5b732ed5004 Author: Freeman Fang AuthorDate: Tue Oct 3 16:10:56 2023 -0400 [CAMEL-19935]upgrade to CXF 4.0.3 --- .../java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java | 6 +++--- .../src/test/java/org/apache/camel/component/cxf/ssl/SslTest.java | 2 +- parent/pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 33af8e8dbfd..6fed84b0eea 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() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); //Test the data format PAYLOAD reply = sendSimpleMessageWithPayloadMessage(getWrongEndpointUri() + "&dataFormat=PAYLOAD"); assertNotNull(reply.getException(), "We should get the exception here"); -assertTrue(reply.getException() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); //Test the data format MESSAGE reply = sendSimpleMessageWithRawMessage(getWrongEndpointUri() + "&dataFormat=RAW"); assertNotNull(reply.getException(), "We should get the exception here"); -assertTrue(reply.getException() instanceof ConnectException); +assertTrue(reply.getException().getCause() instanceof ConnectException); } @Test 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 27d22d99e73..952942ea706 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(); +Throwable e = reply.getException().getCause(); assertEquals("javax.net.ssl.SSLHandshakeException", e.getClass().getCanonicalName()); } diff --git a/parent/pom.xml b/parent/pom.xml index b1355dcc357..df70d033916 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -112,8 +112,8 @@ 2.7 3.4.9 5.5.0 -4.0.2 -4.0.2 +4.0.3 +4.0.3 4.0.0 4.0.0
[camel] branch camel-4.0.x updated: [CAMEL-19843]address similar issue for cxf rest producer
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-4.0.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-4.0.x by this push: new 10fb2b6264b [CAMEL-19843]address similar issue for cxf rest producer 10fb2b6264b is described below commit 10fb2b6264bcacd7b8971e255297a5fa0d457c77 Author: Freeman Fang AuthorDate: Thu Sep 21 19:41:39 2023 -0400 [CAMEL-19843]address similar issue for cxf rest producer (cherry picked from commit 805e1db89bfaaf6d0a9eaf11f52433546acc1f40) --- .../apache/camel/component/cxf/common/header/CxfHeaderHelper.java | 6 -- .../org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java index 48ecf0a01bd..7bbfa5e68ee 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java @@ -190,8 +190,10 @@ public final class CxfHeaderHelper { String camelHeaderName = CXF_TO_CAMEL_HEADERS.getOrDefault(entry.getKey(), entry.getKey()); LOG.trace("Populate external header: {}={} as {}", entry.getKey(), entry.getValue(), camelHeaderName); - -camelHeaders.put(camelHeaderName, entry.getValue().get(0)); +if (!camelHeaderName.startsWith(":")) { +///* Ignore HTTP/2 pseudo headers such as :status */ +camelHeaders.put(camelHeaderName, entry.getValue().get(0)); +} }); } diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java index 9a1c150ba7a..0bdd37832d5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java @@ -312,6 +312,9 @@ public class DefaultCxfRsBinding implements CxfRsBinding, HeaderFilterStrategyAw if (headerFilterStrategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(), camelExchange) || entry.getValue().isEmpty()) { LOG.trace("Drop CXF message protocol header: {}={}", entry.getKey(), entry.getValue()); +} else if (entry.getKey().startsWith(":")) { +/* Ignore HTTP/2 pseudo headers such as :status */ +continue; } else { // just put the first String element, as the complex one is filtered camelMessage.setHeader(entry.getKey(), entry.getValue().get(0));
[camel] branch main updated: [CAMEL-19843]address similar issue for cxf rest producer
This is an automated email from the ASF dual-hosted git repository. ffang 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 805e1db89bf [CAMEL-19843]address similar issue for cxf rest producer 805e1db89bf is described below commit 805e1db89bfaaf6d0a9eaf11f52433546acc1f40 Author: Freeman Fang AuthorDate: Thu Sep 21 19:41:39 2023 -0400 [CAMEL-19843]address similar issue for cxf rest producer --- .../apache/camel/component/cxf/common/header/CxfHeaderHelper.java | 6 -- .../org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java index 48ecf0a01bd..7bbfa5e68ee 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelper.java @@ -190,8 +190,10 @@ public final class CxfHeaderHelper { String camelHeaderName = CXF_TO_CAMEL_HEADERS.getOrDefault(entry.getKey(), entry.getKey()); LOG.trace("Populate external header: {}={} as {}", entry.getKey(), entry.getValue(), camelHeaderName); - -camelHeaders.put(camelHeaderName, entry.getValue().get(0)); +if (!camelHeaderName.startsWith(":")) { +///* Ignore HTTP/2 pseudo headers such as :status */ +camelHeaders.put(camelHeaderName, entry.getValue().get(0)); +} }); } diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java index 9a1c150ba7a..0bdd37832d5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsBinding.java @@ -312,6 +312,9 @@ public class DefaultCxfRsBinding implements CxfRsBinding, HeaderFilterStrategyAw if (headerFilterStrategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(), camelExchange) || entry.getValue().isEmpty()) { LOG.trace("Drop CXF message protocol header: {}={}", entry.getKey(), entry.getValue()); +} else if (entry.getKey().startsWith(":")) { +/* Ignore HTTP/2 pseudo headers such as :status */ +continue; } else { // just put the first String element, as the complex one is filtered camelMessage.setHeader(entry.getKey(), entry.getValue().get(0));
[camel-spring-boot] branch camel-spring-boot-4.0.x updated: [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-4.0.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-4.0.x by this push: new 1591ddc928f [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now 1591ddc928f is described below commit 1591ddc928fcb5ff6a77bfcc23ab2d48e5e44fe9 Author: Freeman Fang AuthorDate: Tue Sep 19 10:10:04 2023 -0400 [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now (cherry picked from commit 8e516b9e612d3669ff69d3aaab14510599cd18f6) --- .../camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java b/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java index 254e2c574db..23fc81cc5ff 100644 --- a/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java +++ b/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java @@ -41,7 +41,6 @@ import org.apache.kafka.common.header.internals.RecordHeader; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -69,7 +68,6 @@ import static org.testcontainers.shaded.org.awaitility.Awaitility.await; KafkaConsumerHealthCheckIT.TestConfiguration.class, } ) -@Disabled("https://issues.apache.org/jira/browse/CAMEL-19854";) public class KafkaConsumerHealthCheckIT extends BaseEmbeddedKafkaTestSupport { public static final String TOPIC = "test-health";
[camel-spring-boot] branch main updated: [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 8e516b9e612 [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now 8e516b9e612 is described below commit 8e516b9e612d3669ff69d3aaab14510599cd18f6 Author: Freeman Fang AuthorDate: Tue Sep 19 10:10:04 2023 -0400 [CAMEL-19854]re-enable KafkaConsumerHealthCheckIT as it's OK now --- .../camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java b/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java index 254e2c574db..23fc81cc5ff 100644 --- a/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java +++ b/components-starter/camel-kafka-starter/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerHealthCheckIT.java @@ -41,7 +41,6 @@ import org.apache.kafka.common.header.internals.RecordHeader; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -69,7 +68,6 @@ import static org.testcontainers.shaded.org.awaitility.Awaitility.await; KafkaConsumerHealthCheckIT.TestConfiguration.class, } ) -@Disabled("https://issues.apache.org/jira/browse/CAMEL-19854";) public class KafkaConsumerHealthCheckIT extends BaseEmbeddedKafkaTestSupport { public static final String TOPIC = "test-health";
[camel] branch camel-3.x updated: [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault
This is an automated email from the ASF dual-hosted git repository. ffang 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 0ead2029c21 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault 0ead2029c21 is described below commit 0ead2029c21b5e043317cf90b0e6a1b3202d7849 Author: Freeman Fang AuthorDate: Wed Jun 7 17:13:53 2023 -0400 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault (cherry picked from commit 57b3c9c9d965a166107e8745c75a256aa2c83cf7) (cherry picked from commit 40e65484e971ccc3ab46eb1cecbccf6c343f1c96) --- .../main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java | 2 ++ .../main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java| 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java index 19a5aba385c..2f209360be5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java @@ -56,6 +56,8 @@ public class CxfRsConsumer extends DefaultConsumer implements Suspendable { svrBean.getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally svrBean.getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); +// close the UnitOfWork in case of Fault +svrBean.getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); Server server = svrBean.create(); diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java index d81bcebb997..83f8f88a2a5 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java @@ -91,7 +91,8 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable { ret.getEndpoint().getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally ret.getEndpoint().getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); - +// close the UnitOfWork in case of Fault +ret.getEndpoint().getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); return ret; }
[camel] branch camel-3.x updated: [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
This is an automated email from the ASF dual-hosted git repository. ffang 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 6e84e21353c [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message 6e84e21353c is described below commit 6e84e21353c8899f0173d38672496f10b3dda7c7 Author: Freeman Fang AuthorDate: Wed Jun 14 12:00:12 2023 -0400 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message (cherry picked from commit 668ae0aa36551d16fdfce004fbbe41a6a5851a2c) (cherry picked from commit 0dd99b4abfdfe08cf565d16e5d9aa4d706868b2e) --- .../apache/camel/component/cxf/jaxws/DefaultCxfBinding.java | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java index 41f3a506a7c..fce4b4b26a3 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java @@ -595,7 +595,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware String contextKey) { // extract from header -Map context = (Map) camelHeaders.get(contextKey); +Map context = null; +if (camelHeaders.get(contextKey) instanceof Map) { +context = (Map) camelHeaders.get(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) { @@ -607,7 +611,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware } // extract from exchange property -context = (Map) camelExchange.getProperty(contextKey); +if (camelExchange.getProperty(contextKey) instanceof Map) { +context = (Map) camelExchange.getProperty(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) {
[camel] branch camel-3.18.x updated: [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new b6f88e532f9 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message b6f88e532f9 is described below commit b6f88e532f91b6f43d82d77af715c10cbaec0e78 Author: Freeman Fang AuthorDate: Wed Jun 14 12:00:12 2023 -0400 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message (cherry picked from commit 668ae0aa36551d16fdfce004fbbe41a6a5851a2c) (cherry picked from commit 0dd99b4abfdfe08cf565d16e5d9aa4d706868b2e) --- .../apache/camel/component/cxf/jaxws/DefaultCxfBinding.java | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java index 0d5abb73da3..e4eb0fdb269 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java @@ -595,7 +595,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware String contextKey) { // extract from header -Map context = (Map) camelHeaders.get(contextKey); +Map context = null; +if (camelHeaders.get(contextKey) instanceof Map) { +context = (Map) camelHeaders.get(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) { @@ -607,7 +611,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware } // extract from exchange property -context = (Map) camelExchange.getProperty(contextKey); +if (camelExchange.getProperty(contextKey) instanceof Map) { +context = (Map) camelExchange.getProperty(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) {
[camel] branch camel-3.20.x updated: [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 0dd99b4abfd [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message 0dd99b4abfd is described below commit 0dd99b4abfdfe08cf565d16e5d9aa4d706868b2e Author: Freeman Fang AuthorDate: Wed Jun 14 12:00:12 2023 -0400 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message (cherry picked from commit 668ae0aa36551d16fdfce004fbbe41a6a5851a2c) --- .../apache/camel/component/cxf/jaxws/DefaultCxfBinding.java | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java index e58b304a88d..662b65a584f 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java @@ -595,7 +595,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware String contextKey) { // extract from header -Map context = (Map) camelHeaders.get(contextKey); +Map context = null; +if (camelHeaders.get(contextKey) instanceof Map) { +context = (Map) camelHeaders.get(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) { @@ -607,7 +611,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware } // extract from exchange property -context = (Map) camelExchange.getProperty(contextKey); +if (camelExchange.getProperty(contextKey) instanceof Map) { +context = (Map) camelExchange.getProperty(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) {
[camel] branch main updated: [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
This is an automated email from the ASF dual-hosted git repository. ffang 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 668ae0aa365 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message 668ae0aa365 is described below commit 668ae0aa36551d16fdfce004fbbe41a6a5851a2c Author: Freeman Fang AuthorDate: Wed Jun 14 12:00:12 2023 -0400 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message --- .../apache/camel/component/cxf/jaxws/DefaultCxfBinding.java | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java index d199eefb6e4..13eb2c68b85 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java @@ -596,7 +596,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware String contextKey) { // extract from header -Map context = (Map) camelHeaders.get(contextKey); +Map context = null; +if (camelHeaders.get(contextKey) instanceof Map) { +context = (Map) camelHeaders.get(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) { @@ -608,7 +612,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware } // extract from exchange property -context = (Map) camelExchange.getProperty(contextKey); +if (camelExchange.getProperty(contextKey) instanceof Map) { +context = (Map) camelExchange.getProperty(contextKey); +} + if (context != null) { cxfContext.putAll(context); if (LOG.isTraceEnabled()) {
[camel] branch camel-3.18.x updated: [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 7aa21983e6d [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault 7aa21983e6d is described below commit 7aa21983e6d9351a3384a4ca48cb2e603a733253 Author: Freeman Fang AuthorDate: Wed Jun 7 17:13:53 2023 -0400 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault (cherry picked from commit 57b3c9c9d965a166107e8745c75a256aa2c83cf7) (cherry picked from commit 40e65484e971ccc3ab46eb1cecbccf6c343f1c96) --- .../main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java | 2 ++ .../main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java| 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java index 19a5aba385c..2f209360be5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java @@ -56,6 +56,8 @@ public class CxfRsConsumer extends DefaultConsumer implements Suspendable { svrBean.getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally svrBean.getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); +// close the UnitOfWork in case of Fault +svrBean.getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); Server server = svrBean.create(); diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java index d8cf741d1dc..e97cce45d45 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java @@ -91,7 +91,8 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable { server.getEndpoint().getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally server.getEndpoint().getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); - +// close the UnitOfWork in case of Fault +server.getEndpoint().getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); return server; }
[camel] branch camel-3.20.x updated: [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 40e65484e97 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault 40e65484e97 is described below commit 40e65484e971ccc3ab46eb1cecbccf6c343f1c96 Author: Freeman Fang AuthorDate: Wed Jun 7 17:13:53 2023 -0400 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault (cherry picked from commit 57b3c9c9d965a166107e8745c75a256aa2c83cf7) --- .../main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java | 2 ++ .../main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java| 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java index 19a5aba385c..2f209360be5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java @@ -56,6 +56,8 @@ public class CxfRsConsumer extends DefaultConsumer implements Suspendable { svrBean.getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally svrBean.getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); +// close the UnitOfWork in case of Fault +svrBean.getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); Server server = svrBean.create(); diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java index d81bcebb997..83f8f88a2a5 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java @@ -91,7 +91,8 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable { ret.getEndpoint().getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally ret.getEndpoint().getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); - +// close the UnitOfWork in case of Fault +ret.getEndpoint().getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); return ret; }
[camel] branch main updated: [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault
This is an automated email from the ASF dual-hosted git repository. ffang 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 57b3c9c9d96 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault 57b3c9c9d96 is described below commit 57b3c9c9d965a166107e8745c75a256aa2c83cf7 Author: Freeman Fang AuthorDate: Wed Jun 7 17:13:53 2023 -0400 [CAMEL-18965]Camel-CXF: OnCompletion not working in case of Fault --- .../main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java | 2 ++ .../main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java| 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java index 19a5aba385c..2f209360be5 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumer.java @@ -56,6 +56,8 @@ public class CxfRsConsumer extends DefaultConsumer implements Suspendable { svrBean.getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally svrBean.getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); +// close the UnitOfWork in case of Fault +svrBean.getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); Server server = svrBean.create(); diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java index 27cf41bf46b..e02943bc9e9 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfConsumer.java @@ -91,7 +91,8 @@ public class CxfConsumer extends DefaultConsumer implements Suspendable { ret.getEndpoint().getInInterceptors().add(new UnitOfWorkCloserInterceptor(Phase.POST_INVOKE, true)); // close the UnitOfWork normally ret.getEndpoint().getOutInterceptors().add(new UnitOfWorkCloserInterceptor()); - +// close the UnitOfWork in case of Fault +ret.getEndpoint().getOutFaultInterceptors().add(new UnitOfWorkCloserInterceptor()); return ret; }
[camel] branch camel-3.18.x updated: [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new e328a826bd3 [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date e328a826bd3 is described below commit e328a826bd3056debada96d8b377223f37f21e5b Author: Freeman Fang AuthorDate: Tue Jun 6 13:19:03 2023 -0400 [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date (cherry picked from commit ee6a4a7f5887ca7185766f7806e4fd8a47c5a885) (cherry picked from commit 8a0e776160bbb3f93043fb133bbc472202574ce6) --- .../src/main/docs/cxf-component.adoc | 75 -- 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 7835af8d76d..6001ad2fbc5 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -766,7 +766,7 @@ following is an example. --- -=== Description of relayHeaders option +== Description of CxfHeaderFilterStrategy options There are _in-band_ and _out-of-band_ on-the-wire headers from the perspective of a JAXWS WSDL-first developer. @@ -781,55 +781,30 @@ Headers relaying/filtering is bi-directional. When a route has a CXF endpoint and the developer needs to have on-the-wire headers, such as SOAP headers, be relayed along the route to -be consumed say by another JAXWS endpoint, then `relayHeaders` should be -set to `true`, which is the default value. +be consumed say by another JAXWS endpoint, a `CxfHeaderFilterStrategy` +instance should be set on the CXF endpoint, then `relayHeaders` property +of the `CxfHeaderFilterStrategy` instance should be set to `true`, which +is the default value. Plus, the `CxfHeaderFilterStrategy` instance also +holds a list of `MessageHeaderFilter` interface, which decides if a specific +header will be relayed or not. -=== Available only in POJO mode -The `relayHeaders=true` expresses an intent to relay the headers. The -actual decision on whether a given header is relayed is delegated to a -pluggable instance that implements the `MessageHeadersRelay` interface. -A concrete implementation of `MessageHeadersRelay` will be consulted to -decide if a header needs to be relayed or not. There is already an -implementation of `SoapMessageHeadersRelay` which binds itself to -well-known SOAP name spaces. Currently only out-of-band headers are -filtered, and in-band headers will always be relayed when -`relayHeaders=true`. If there is a header on the wire whose name space -is unknown to the runtime, then a fall back `DefaultMessageHeadersRelay` -will be used, which simply allows all headers to be relayed. - -The `relayHeaders=false` setting specifies that all headers in-band and -out-of-band should be dropped. - -You can plugin your own `MessageHeadersRelay` implementations overriding -or adding additional ones to the list of relays. In order to override a -preloaded relay instance just make sure that your `MessageHeadersRelay` -implementation services the same name spaces as the one you looking to -override. Also note, that the overriding relay has to service all of the -name spaces as the one you looking to override, or else a runtime -exception on route start up will be thrown as this would introduce an -ambiguity in name spaces to relay instance mappings. - -[source,xml] - - - - - - - - - - Take a look at the tests that show how you'd be able to relay/drop headers here: https://github.com/apache/camel/blob/main/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest.java[CxfMessageHeadersRelayTest] +* The `relayHeaders=true` expresses an intent to relay the headers. The +actual decision on whether a given header is relayed is delegated to a +pluggable instance that implements the `MessageHeaderFilter` interface. +A concrete implementation of `MessageHeaderFilter` will be consulted to +decide if a header needs to be relayed or not. There is already an +implementation of `SoapMessageHeaderFilter` which binds itself to +well-known SOAP name spaces. If there is a header on the wire whose name space +is unknown to the runtime, the header will be simply relayed. + * `POJO` and `PAYLOAD` modes are supporte
[camel] branch camel-3.20.x updated: [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 8a0e776160b [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date 8a0e776160b is described below commit 8a0e776160bbb3f93043fb133bbc472202574ce6 Author: Freeman Fang AuthorDate: Tue Jun 6 13:19:03 2023 -0400 [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date (cherry picked from commit ee6a4a7f5887ca7185766f7806e4fd8a47c5a885) --- .../src/main/docs/cxf-component.adoc | 75 -- 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 7835af8d76d..6001ad2fbc5 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -766,7 +766,7 @@ following is an example. --- -=== Description of relayHeaders option +== Description of CxfHeaderFilterStrategy options There are _in-band_ and _out-of-band_ on-the-wire headers from the perspective of a JAXWS WSDL-first developer. @@ -781,55 +781,30 @@ Headers relaying/filtering is bi-directional. When a route has a CXF endpoint and the developer needs to have on-the-wire headers, such as SOAP headers, be relayed along the route to -be consumed say by another JAXWS endpoint, then `relayHeaders` should be -set to `true`, which is the default value. +be consumed say by another JAXWS endpoint, a `CxfHeaderFilterStrategy` +instance should be set on the CXF endpoint, then `relayHeaders` property +of the `CxfHeaderFilterStrategy` instance should be set to `true`, which +is the default value. Plus, the `CxfHeaderFilterStrategy` instance also +holds a list of `MessageHeaderFilter` interface, which decides if a specific +header will be relayed or not. -=== Available only in POJO mode -The `relayHeaders=true` expresses an intent to relay the headers. The -actual decision on whether a given header is relayed is delegated to a -pluggable instance that implements the `MessageHeadersRelay` interface. -A concrete implementation of `MessageHeadersRelay` will be consulted to -decide if a header needs to be relayed or not. There is already an -implementation of `SoapMessageHeadersRelay` which binds itself to -well-known SOAP name spaces. Currently only out-of-band headers are -filtered, and in-band headers will always be relayed when -`relayHeaders=true`. If there is a header on the wire whose name space -is unknown to the runtime, then a fall back `DefaultMessageHeadersRelay` -will be used, which simply allows all headers to be relayed. - -The `relayHeaders=false` setting specifies that all headers in-band and -out-of-band should be dropped. - -You can plugin your own `MessageHeadersRelay` implementations overriding -or adding additional ones to the list of relays. In order to override a -preloaded relay instance just make sure that your `MessageHeadersRelay` -implementation services the same name spaces as the one you looking to -override. Also note, that the overriding relay has to service all of the -name spaces as the one you looking to override, or else a runtime -exception on route start up will be thrown as this would introduce an -ambiguity in name spaces to relay instance mappings. - -[source,xml] - - - - - - - - - - Take a look at the tests that show how you'd be able to relay/drop headers here: https://github.com/apache/camel/blob/main/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest.java[CxfMessageHeadersRelayTest] +* The `relayHeaders=true` expresses an intent to relay the headers. The +actual decision on whether a given header is relayed is delegated to a +pluggable instance that implements the `MessageHeaderFilter` interface. +A concrete implementation of `MessageHeaderFilter` will be consulted to +decide if a header needs to be relayed or not. There is already an +implementation of `SoapMessageHeaderFilter` which binds itself to +well-known SOAP name spaces. If there is a header on the wire whose name space +is unknown to the runtime, the header will be simply relayed. + * `POJO` and `PAYLOAD` modes are supported. In `POJO` mode, only out-of-band message headers are available for filt
[camel] branch main updated: [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date
This is an automated email from the ASF dual-hosted git repository. ffang 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 ee6a4a7f588 [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date ee6a4a7f588 is described below commit ee6a4a7f5887ca7185766f7806e4fd8a47c5a885 Author: Freeman Fang AuthorDate: Tue Jun 6 13:19:03 2023 -0400 [CAMEL-19418]camel-cxf document: ensure CxfHeaderFilterStrategy description is up-to-date --- .../src/main/docs/cxf-component.adoc | 74 -- 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 34dd5e379aa..50eb134e34b 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -877,7 +877,7 @@ XML (Spring):: -== Description of relayHeaders option +== Description of CxfHeaderFilterStrategy options There are _in-band_ and _out-of-band_ on-the-wire headers from the perspective of a JAXWS WSDL-first developer. @@ -892,48 +892,15 @@ Headers relaying/filtering is bi-directional. When a route has a CXF endpoint and the developer needs to have on-the-wire headers, such as SOAP headers, be relayed along the route to -be consumed say by another JAXWS endpoint, then `relayHeaders` should be -set to `true`, which is the default value. +be consumed say by another JAXWS endpoint, a `CxfHeaderFilterStrategy` +instance should be set on the CXF endpoint, then `relayHeaders` property +of the `CxfHeaderFilterStrategy` instance should be set to `true`, which +is the default value. Plus, the `CxfHeaderFilterStrategy` instance also +holds a list of `MessageHeaderFilter` interface, which decides if a specific +header will be relayed or not. -=== Available only in POJO mode -The `relayHeaders=true` expresses an intent to relay the headers. The -actual decision on whether a given header is relayed is delegated to a -pluggable instance that implements the `MessageHeadersRelay` interface. -A concrete implementation of `MessageHeadersRelay` will be consulted to -decide if a header needs to be relayed or not. There is already an -implementation of `SoapMessageHeadersRelay` which binds itself to -well-known SOAP name spaces. Currently only out-of-band headers are -filtered, and in-band headers will always be relayed when -`relayHeaders=true`. If there is a header on the wire whose name space -is unknown to the runtime, then a fall back `DefaultMessageHeadersRelay` -will be used, which simply allows all headers to be relayed. - -The `relayHeaders=false` setting specifies that all headers in-band and -out-of-band should be dropped. - -You can plugin your own `MessageHeadersRelay` implementations overriding -or adding additional ones to the list of relays. In order to override a -preloaded relay instance just make sure that your `MessageHeadersRelay` -implementation services the same name spaces as the one you looking to -override. Also note, that the overriding relay has to service all of the -name spaces as the one you looking to override, or else a runtime -exception on route start up will be thrown as this would introduce an -ambiguity in name spaces to relay instance mappings. - -[source,xml] - - - - - - - - - - - Take a look at the tests that show how you'd be able to relay/drop @@ -941,6 +908,15 @@ headers here: https://github.com/apache/camel/blob/main/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessageHeadersRelayTest.java[CxfMessageHeadersRelayTest] +* The `relayHeaders=true` expresses an intent to relay the headers. The +actual decision on whether a given header is relayed is delegated to a +pluggable instance that implements the `MessageHeaderFilter` interface. +A concrete implementation of `MessageHeaderFilter` will be consulted to +decide if a header needs to be relayed or not. There is already an +implementation of `SoapMessageHeaderFilter` which binds itself to +well-known SOAP name spaces. If there is a header on the wire whose name space +is unknown to the runtime, the header will be simply relayed. + * `POJO` and `PAYLOAD` modes are supported. In `POJO` mode, only out-of-band message headers are available for filtering as the in-band headers have been processed and removed from header list by CXF. The @@ -949,11 +925,8 @@ mode. The `camel-cxf` component does make any attempt to remove the in-band headers from the `MessageContentList`. If filtering of in-band headers is required, please use `PAYLOAD` mode or plug in a (pretty straightforward) CXF interceptor/JAXWS Handler to th
[camel-spring-boot] branch camel-spring-boot-3.18.x updated: [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.18.x by this push: new a7f1994b192 [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters a7f1994b192 is described below commit a7f1994b192db5c7146f2f479f40febed1b5e600 Author: Freeman Fang AuthorDate: Wed May 10 13:55:14 2023 -0400 [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters (cherry picked from commit e0147ef989361b7aa76b82b2491a07d6e27c1261) --- components-starter/camel-cxf-rest-starter/pom.xml | 1 - components-starter/camel-cxf-soap-starter/pom.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index b18116fe064..bfbe64e8d47 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -82,7 +82,6 @@ org.apache.cxf cxf-spring-boot-starter-jaxrs - test ${cxf-version} diff --git a/components-starter/camel-cxf-soap-starter/pom.xml b/components-starter/camel-cxf-soap-starter/pom.xml index 8fc9605e9da..a38ab71b043 100644 --- a/components-starter/camel-cxf-soap-starter/pom.xml +++ b/components-starter/camel-cxf-soap-starter/pom.xml @@ -102,7 +102,6 @@ org.apache.cxf cxf-spring-boot-starter-jaxws - test ${cxf-version}
[camel-spring-boot] branch camel-spring-boot-3.20.x updated: [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.20.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.20.x by this push: new e0147ef9893 [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters e0147ef9893 is described below commit e0147ef989361b7aa76b82b2491a07d6e27c1261 Author: Freeman Fang AuthorDate: Wed May 10 13:55:14 2023 -0400 [CAMEl-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters --- components-starter/camel-cxf-rest-starter/pom.xml | 1 - components-starter/camel-cxf-soap-starter/pom.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index 93b748a5d0f..1a98496953b 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -82,7 +82,6 @@ org.apache.cxf cxf-spring-boot-starter-jaxrs - test ${cxf-version} diff --git a/components-starter/camel-cxf-soap-starter/pom.xml b/components-starter/camel-cxf-soap-starter/pom.xml index 38a96dea674..3a033442cf4 100644 --- a/components-starter/camel-cxf-soap-starter/pom.xml +++ b/components-starter/camel-cxf-soap-starter/pom.xml @@ -102,7 +102,6 @@ org.apache.cxf cxf-spring-boot-starter-jaxws - test ${cxf-version}
[camel-spring-boot] branch main updated: [CAMEL-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 1aa25da80c2 [CAMEL-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters 1aa25da80c2 is described below commit 1aa25da80c2754cca011dd752607f3bf628a436f Author: Freeman Fang AuthorDate: Wed May 10 13:54:05 2023 -0400 [CAMEL-19333]ensure cxf springboot autoconfiguration works OOTB in camel-cxf springboot starters --- components-starter/camel-cxf-rest-starter/pom.xml | 5 + components-starter/camel-cxf-soap-starter/pom.xml | 5 + 2 files changed, 10 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index 58f6ebfe6de..c38df9877b9 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -38,6 +38,11 @@ camel-cxf-spring-rest ${camel-version} + + org.apache.cxf + cxf-spring-boot-starter-jaxrs + ${cxf-version} + org.apache.camel.springboot diff --git a/components-starter/camel-cxf-soap-starter/pom.xml b/components-starter/camel-cxf-soap-starter/pom.xml index 940039a6eb5..1958abd25ce 100644 --- a/components-starter/camel-cxf-soap-starter/pom.xml +++ b/components-starter/camel-cxf-soap-starter/pom.xml @@ -38,6 +38,11 @@ camel-cxf-spring-soap ${camel-version} + + org.apache.cxf + cxf-spring-boot-starter-jaxws + ${cxf-version} + org.apache.camel.springboot
[camel] branch camel-3.18.x updated: [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 1bfa2f97f67 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) 1bfa2f97f67 is described below commit 1bfa2f97f6768c34881e81eac9f2fa6bed8fee38 Author: Freeman(Yue) Fang AuthorDate: Tue May 9 09:05:02 2023 -0400 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) (cherry picked from commit 86f2fa577b868670a857bd320eb63928dc9bb2ed) (cherry picked from commit f373bc72cc4616107e6d18af9b3a46b64fdc5bbf) --- .../component/cxf/converter/CxfConverter.java | 22 -- .../component/cxf/converter/ConverterTest.java | 11 +++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java index db5dba3727a..9f5744a75ea 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java @@ -101,8 +101,9 @@ public final class CxfConverter { /** * Use a fallback type converter so we can convert the embedded list element if the value is MessageContentsList. * The algorithm of this converter finds the first non-null list element from the list and applies conversion to the - * list element. - * + * list element if can determine this MessageContentsList is used in CXF context(first element is the return value + * while others are Holders). + * * @param type the desired type to be converted to * @param exchange optional exchange which can be null * @param valuethe object to be converted @@ -119,6 +120,23 @@ public final class CxfConverter { if (MessageContentsList.class.isAssignableFrom(value.getClass())) { MessageContentsList list = (MessageContentsList) value; +if (list.size() > 1 && type == String.class) { +//to check if the MessageContentsList is used in CXF context +//If not, use the general way to convert from List.class to String.class +boolean foundHolder = false; +for (Object embedded : list) { +if (embedded != null && embedded.getClass().getName().equals("javax.xml.ws.Holder")) { +foundHolder = true; +break; +} +} +if (!foundHolder) { +// this isn't a typical CXF MessageContentsList +// just using other fallback converters +return null; +} +} + // try to turn the first array element into the object that we want for (Object embedded : list) { if (embedded != null) { diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java index 81fe256ac8b..7cf81bab063 100644 --- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java +++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java @@ -79,4 +79,15 @@ public class ConverterTest { assertNotNull(node); } +@Test +public void testMessageContentsListAsGeneralList() throws Exception { +CamelContext context = new DefaultCamelContext(); +Exchange exchange = new DefaultExchange(context); +MessageContentsList list = new MessageContentsList(); +list.add("hehe"); +list.add("haha"); +exchange.getIn().setBody(list); +String ret = exchange.getIn().getBody(String.class); +assertEquals(ret, "[hehe, haha]", "shouldn't miss list content"); +} }
[camel] branch camel-3.20.x updated: [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new f373bc72cc4 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) f373bc72cc4 is described below commit f373bc72cc4616107e6d18af9b3a46b64fdc5bbf Author: Freeman(Yue) Fang AuthorDate: Tue May 9 09:05:02 2023 -0400 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) (cherry picked from commit 86f2fa577b868670a857bd320eb63928dc9bb2ed) --- .../camel/component/cxf/converter/CxfConverter.java | 20 +++- .../camel/component/cxf/converter/ConverterTest.java | 11 +++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java index e0c28a21f56..9f5744a75ea 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java @@ -101,7 +101,8 @@ public final class CxfConverter { /** * Use a fallback type converter so we can convert the embedded list element if the value is MessageContentsList. * The algorithm of this converter finds the first non-null list element from the list and applies conversion to the - * list element. + * list element if can determine this MessageContentsList is used in CXF context(first element is the return value + * while others are Holders). * * @param type the desired type to be converted to * @param exchange optional exchange which can be null @@ -119,6 +120,23 @@ public final class CxfConverter { if (MessageContentsList.class.isAssignableFrom(value.getClass())) { MessageContentsList list = (MessageContentsList) value; +if (list.size() > 1 && type == String.class) { +//to check if the MessageContentsList is used in CXF context +//If not, use the general way to convert from List.class to String.class +boolean foundHolder = false; +for (Object embedded : list) { +if (embedded != null && embedded.getClass().getName().equals("javax.xml.ws.Holder")) { +foundHolder = true; +break; +} +} +if (!foundHolder) { +// this isn't a typical CXF MessageContentsList +// just using other fallback converters +return null; +} +} + // try to turn the first array element into the object that we want for (Object embedded : list) { if (embedded != null) { diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java index 81fe256ac8b..7cf81bab063 100644 --- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java +++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java @@ -79,4 +79,15 @@ public class ConverterTest { assertNotNull(node); } +@Test +public void testMessageContentsListAsGeneralList() throws Exception { +CamelContext context = new DefaultCamelContext(); +Exchange exchange = new DefaultExchange(context); +MessageContentsList list = new MessageContentsList(); +list.add("hehe"); +list.add("haha"); +exchange.getIn().setBody(list); +String ret = exchange.getIn().getBody(String.class); +assertEquals(ret, "[hehe, haha]", "shouldn't miss list content"); +} }
[camel] branch main updated: [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001)
This is an automated email from the ASF dual-hosted git repository. ffang 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 86f2fa577b8 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) 86f2fa577b8 is described below commit 86f2fa577b868670a857bd320eb63928dc9bb2ed Author: Freeman(Yue) Fang AuthorDate: Tue May 9 09:05:02 2023 -0400 [CAMEL-19324]Be able to convert all elements from CXF MessageContentsList.class to String.class if not in "CXF Context" (#10001) --- .../camel/component/cxf/converter/CxfConverter.java | 20 +++- .../camel/component/cxf/converter/ConverterTest.java | 11 +++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java index 222b0c6dce8..c3870e210cc 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java @@ -101,7 +101,8 @@ public final class CxfConverter { /** * Use a fallback type converter so we can convert the embedded list element if the value is MessageContentsList. * The algorithm of this converter finds the first non-null list element from the list and applies conversion to the - * list element. + * list element if can determine this MessageContentsList is used in CXF context(first element is the return value + * while others are Holders). * * @param type the desired type to be converted to * @param exchange optional exchange which can be null @@ -119,6 +120,23 @@ public final class CxfConverter { if (MessageContentsList.class.isAssignableFrom(value.getClass())) { MessageContentsList list = (MessageContentsList) value; +if (list.size() > 1 && type == String.class) { +//to check if the MessageContentsList is used in CXF context +//If not, use the general way to convert from List.class to String.class +boolean foundHolder = false; +for (Object embedded : list) { +if (embedded != null && embedded.getClass().getName().equals("javax.xml.ws.Holder")) { +foundHolder = true; +break; +} +} +if (!foundHolder) { +// this isn't a typical CXF MessageContentsList +// just using other fallback converters +return null; +} +} + // try to turn the first array element into the object that we want for (Object embedded : list) { if (embedded != null) { diff --git a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java index 81fe256ac8b..7cf81bab063 100644 --- a/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java +++ b/components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/converter/ConverterTest.java @@ -79,4 +79,15 @@ public class ConverterTest { assertNotNull(node); } +@Test +public void testMessageContentsListAsGeneralList() throws Exception { +CamelContext context = new DefaultCamelContext(); +Exchange exchange = new DefaultExchange(context); +MessageContentsList list = new MessageContentsList(); +list.add("hehe"); +list.add("haha"); +exchange.getIn().setBody(list); +String ret = exchange.getIn().getBody(String.class); +assertEquals(ret, "[hehe, haha]", "shouldn't miss list content"); +} }
[camel] branch camel-3.18.x updated: camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 3def7fa3f38 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() 3def7fa3f38 is described below commit 3def7fa3f38f18eb311b2b860a8508b0ba4252db Author: Freeman Fang AuthorDate: Fri Apr 28 14:49:10 2023 -0400 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() (cherry picked from commit 93a1ba2ae62e4a5fb46a5e43f364b40cfb60a93d) (cherry picked from commit 29466acea75d52c16523c82dfccbecd655d74a19) --- .../camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc | 6 +++--- .../camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc index 92d49e4ed20..74b83e2d5f2 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc +++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc @@ -352,13 +352,13 @@ Exchange exchange = template.send("direct://proxy", new Processor() { }); // get the response message -Customer response = (Customer) exchange.getOut().getBody(); +Customer response = (Customer) exchange.getMessage().getBody(); assertNotNull(response, "The response should not be null"); assertEquals(123, response.getId(), "Get a wrong customer id"); assertEquals("John", response.getName(), "Get a wrong customer name"); -assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); -assertEquals("value", exchange.getOut().getHeader("key"), "Get a wrong header value"); +assertEquals(200, exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); +assertEquals("value", exchange.getMessage().getHeader("key"), "Get a wrong header value"); The http://cxf.apache.org/docs/jax-rs.html[CXF JAXRS front end] also diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 915f518fc4a..59d4cfca254 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -538,7 +538,7 @@ As an alternative you can add a message header for it as demonstrated in https:/ // set up the response context which force start document Map map = new HashMap(); map.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE); - exchange.getOut().setHeader(Client.RESPONSE_CONTEXT, map); + exchange.getMessage().setHeader(Client.RESPONSE_CONTEXT, map); --- == How to override the CXF producer address from message header @@ -856,7 +856,7 @@ code in the message header as demonstrated by https://github.com/apache/camel/bl from(routerEndpointURI).process(new Processor() { public void process(Exchange exchange) throws Exception { -Message out = exchange.getOut(); +Message out = exchange.getMessage(); // Set the message body with the out.setBody(this.getClass().getResourceAsStream("SoapFaultMessage.xml")); // Set the response code here @@ -892,7 +892,7 @@ response context with the following code: exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION); } }); - org.apache.camel.Message out = exchange.getOut(); + org.apache.camel.Message out = exchange.getMessage(); // The output is an object array, the first element of the array is the return value Object\[\] output = out.getBody(Object\[\].class); LOG.info("Received output text: " + output\[0\]);
[camel] branch camel-3.20.x updated: camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 29466acea75 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() 29466acea75 is described below commit 29466acea75d52c16523c82dfccbecd655d74a19 Author: Freeman Fang AuthorDate: Fri Apr 28 14:49:10 2023 -0400 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() (cherry picked from commit 93a1ba2ae62e4a5fb46a5e43f364b40cfb60a93d) --- .../camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc | 6 +++--- .../camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc index 92d49e4ed20..74b83e2d5f2 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc +++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc @@ -352,13 +352,13 @@ Exchange exchange = template.send("direct://proxy", new Processor() { }); // get the response message -Customer response = (Customer) exchange.getOut().getBody(); +Customer response = (Customer) exchange.getMessage().getBody(); assertNotNull(response, "The response should not be null"); assertEquals(123, response.getId(), "Get a wrong customer id"); assertEquals("John", response.getName(), "Get a wrong customer name"); -assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); -assertEquals("value", exchange.getOut().getHeader("key"), "Get a wrong header value"); +assertEquals(200, exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); +assertEquals("value", exchange.getMessage().getHeader("key"), "Get a wrong header value"); The http://cxf.apache.org/docs/jax-rs.html[CXF JAXRS front end] also diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 915f518fc4a..59d4cfca254 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -538,7 +538,7 @@ As an alternative you can add a message header for it as demonstrated in https:/ // set up the response context which force start document Map map = new HashMap(); map.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE); - exchange.getOut().setHeader(Client.RESPONSE_CONTEXT, map); + exchange.getMessage().setHeader(Client.RESPONSE_CONTEXT, map); --- == How to override the CXF producer address from message header @@ -856,7 +856,7 @@ code in the message header as demonstrated by https://github.com/apache/camel/bl from(routerEndpointURI).process(new Processor() { public void process(Exchange exchange) throws Exception { -Message out = exchange.getOut(); +Message out = exchange.getMessage(); // Set the message body with the out.setBody(this.getClass().getResourceAsStream("SoapFaultMessage.xml")); // Set the response code here @@ -892,7 +892,7 @@ response context with the following code: exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION); } }); - org.apache.camel.Message out = exchange.getOut(); + org.apache.camel.Message out = exchange.getMessage(); // The output is an object array, the first element of the array is the return value Object\[\] output = out.getBody(Object\[\].class); LOG.info("Received output text: " + output\[0\]);
[camel] branch main updated: camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()
This is an automated email from the ASF dual-hosted git repository. ffang 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 93a1ba2ae62 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() 93a1ba2ae62 is described below commit 93a1ba2ae62e4a5fb46a5e43f364b40cfb60a93d Author: Freeman Fang AuthorDate: Fri Apr 28 14:49:10 2023 -0400 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut() --- .../camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc | 6 +++--- .../camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc index 92d49e4ed20..74b83e2d5f2 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc +++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc @@ -352,13 +352,13 @@ Exchange exchange = template.send("direct://proxy", new Processor() { }); // get the response message -Customer response = (Customer) exchange.getOut().getBody(); +Customer response = (Customer) exchange.getMessage().getBody(); assertNotNull(response, "The response should not be null"); assertEquals(123, response.getId(), "Get a wrong customer id"); assertEquals("John", response.getName(), "Get a wrong customer name"); -assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); -assertEquals("value", exchange.getOut().getHeader("key"), "Get a wrong header value"); +assertEquals(200, exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code"); +assertEquals("value", exchange.getMessage().getHeader("key"), "Get a wrong header value"); The http://cxf.apache.org/docs/jax-rs.html[CXF JAXRS front end] also diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 9411171061a..77d55858666 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -475,7 +475,7 @@ code in the message header as demonstrated by https://github.com/apache/camel/bl from(routerEndpointURI).process(new Processor() { public void process(Exchange exchange) throws Exception { -Message out = exchange.getOut(); +Message out = exchange.getMessage(); // Set the message body with the out.setBody(this.getClass().getResourceAsStream("SoapFaultMessage.xml")); // Set the response code here @@ -511,7 +511,7 @@ response context with the following code: exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION); } }); - org.apache.camel.Message out = exchange.getOut(); + org.apache.camel.Message out = exchange.getMessage(); // The output is an object array, the first element of the array is the return value Object\[\] output = out.getBody(Object\[\].class); LOG.info("Received output text: " + output\[0\]); @@ -950,7 +950,7 @@ As an alternative you can add a message header for it as demonstrated in https:/ // set up the response context which force start document Map map = new HashMap(); map.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE); - exchange.getOut().setHeader(Client.RESPONSE_CONTEXT, map); + exchange.getMessage().setHeader(Client.RESPONSE_CONTEXT, map); --- == Configure the CXF endpoints with Spring
[camel] branch camel-3.18.x updated: [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 55a35390341 [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) 55a35390341 is described below commit 55a3539034195a3a7fdf579e360369ea421d7fb9 Author: Freeman(Yue) Fang AuthorDate: Thu Apr 13 14:53:22 2023 -0400 [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) (cherry picked from commit 1a0a47bb6a289ae4e552fd6770c850860e173b90) (cherry picked from commit 0ca55256b9cecee8fce024eb0b0183bd56aaa1cb) --- .../org/apache/camel/component/cxf/converter/CxfPayloadConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java index 9b5337d7277..e63ac48b80b 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java @@ -180,8 +180,8 @@ public final class CxfPayloadConverter { // the internal conversion to XML can throw an exception if the content is not XML // ignore this and return MISS_VALUE to indicate that we cannot convert this } -// no we could not do it currently -return (T) MISS_VALUE; +// Let other fallback converter try +return null; } // Convert a CxfPayload into something else if (CxfPayload.class.isAssignableFrom(value.getClass())) {
[camel] branch camel-3.20.x updated: [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 0ca55256b9c [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) 0ca55256b9c is described below commit 0ca55256b9cecee8fce024eb0b0183bd56aaa1cb Author: Freeman(Yue) Fang AuthorDate: Thu Apr 13 14:53:22 2023 -0400 [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) (cherry picked from commit 1a0a47bb6a289ae4e552fd6770c850860e173b90) --- .../org/apache/camel/component/cxf/converter/CxfPayloadConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java index 9b5337d7277..e63ac48b80b 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java @@ -180,8 +180,8 @@ public final class CxfPayloadConverter { // the internal conversion to XML can throw an exception if the content is not XML // ignore this and return MISS_VALUE to indicate that we cannot convert this } -// no we could not do it currently -return (T) MISS_VALUE; +// Let other fallback converter try +return null; } // Convert a CxfPayload into something else if (CxfPayload.class.isAssignableFrom(value.getClass())) {
[camel] branch main updated: [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859)
This is an automated email from the ASF dual-hosted git repository. ffang 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 1a0a47bb6a2 [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) 1a0a47bb6a2 is described below commit 1a0a47bb6a289ae4e552fd6770c850860e173b90 Author: Freeman(Yue) Fang AuthorDate: Thu Apr 13 14:53:22 2023 -0400 [CAMEL-19160]return null for CxfPayloadConverter fallback converter so that other fallback coverter can get a chance to try (#9859) --- .../org/apache/camel/component/cxf/converter/CxfPayloadConverter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java index 9b5337d7277..e63ac48b80b 100644 --- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java +++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java @@ -180,8 +180,8 @@ public final class CxfPayloadConverter { // the internal conversion to XML can throw an exception if the content is not XML // ignore this and return MISS_VALUE to indicate that we cannot convert this } -// no we could not do it currently -return (T) MISS_VALUE; +// Let other fallback converter try +return null; } // Convert a CxfPayload into something else if (CxfPayload.class.isAssignableFrom(value.getClass())) {
[camel] branch camel-3.18.x updated: [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new ee1cfb1c690 [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property ee1cfb1c690 is described below commit ee1cfb1c6901a63ad33e03a043abe1d21c9299dd Author: Freeman Fang AuthorDate: Wed Feb 15 15:50:14 2023 -0500 [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property (cherry picked from commit 465dc801e2dc48fc57e450c76d200cf1e5a35e4e) (cherry picked from commit 2f1615af7df2f9d040031d1c0453e41a813a6eb4) --- .../cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java | 18 ++ 1 file changed, 18 insertions(+) diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java index 3f00225ce33..2b9b51bdcaa 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java @@ -25,6 +25,7 @@ import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor; import org.apache.cxf.ext.logging.LoggingFeature; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean; +import org.apache.cxf.jaxrs.model.ClassResourceInfo; import org.apache.cxf.logging.FaultListener; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; @@ -36,6 +37,7 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean private String beanId; private LoggingFeature loggingFeature; private int loggingSizeLimit; +private boolean performInvocation; public SpringJAXRSServerFactoryBean() { } @@ -113,4 +115,20 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); } } + +@Override +protected boolean isValidClassResourceInfo(ClassResourceInfo cri) { +// CXF will consider interfaces created for managing model resources +// invalid - however it is fine with Camel processors if no service invocation +// is requested. +return !isPerformInvocation() || !cri.getServiceClass().isInterface(); +} + +public boolean isPerformInvocation() { +return performInvocation; +} + +public void setPerformInvocation(boolean performInvocation) { +this.performInvocation = performInvocation; +} }
[camel] branch camel-3.20.x updated: [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new 2f1615af7df [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property 2f1615af7df is described below commit 2f1615af7df2f9d040031d1c0453e41a813a6eb4 Author: Freeman Fang AuthorDate: Wed Feb 15 15:50:14 2023 -0500 [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property (cherry picked from commit 465dc801e2dc48fc57e450c76d200cf1e5a35e4e) --- .../cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java | 18 ++ 1 file changed, 18 insertions(+) diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java index 3f00225ce33..2b9b51bdcaa 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java @@ -25,6 +25,7 @@ import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor; import org.apache.cxf.ext.logging.LoggingFeature; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean; +import org.apache.cxf.jaxrs.model.ClassResourceInfo; import org.apache.cxf.logging.FaultListener; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; @@ -36,6 +37,7 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean private String beanId; private LoggingFeature loggingFeature; private int loggingSizeLimit; +private boolean performInvocation; public SpringJAXRSServerFactoryBean() { } @@ -113,4 +115,20 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); } } + +@Override +protected boolean isValidClassResourceInfo(ClassResourceInfo cri) { +// CXF will consider interfaces created for managing model resources +// invalid - however it is fine with Camel processors if no service invocation +// is requested. +return !isPerformInvocation() || !cri.getServiceClass().isInterface(); +} + +public boolean isPerformInvocation() { +return performInvocation; +} + +public void setPerformInvocation(boolean performInvocation) { +this.performInvocation = performInvocation; +} }
[camel] branch main updated: [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property
This is an automated email from the ASF dual-hosted git repository. ffang 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 465dc801e2d [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property 465dc801e2d is described below commit 465dc801e2dc48fc57e450c76d200cf1e5a35e4e Author: Freeman Fang AuthorDate: Wed Feb 15 15:50:14 2023 -0500 [CAMEL-19057]Be able to configure SpringJAXRSServerFactoryBean with performInvocation property --- .../cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java | 18 ++ 1 file changed, 18 insertions(+) diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java index 3f00225ce33..2b9b51bdcaa 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/SpringJAXRSServerFactoryBean.java @@ -25,6 +25,7 @@ import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor; import org.apache.cxf.ext.logging.LoggingFeature; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean; +import org.apache.cxf.jaxrs.model.ClassResourceInfo; import org.apache.cxf.logging.FaultListener; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; @@ -36,6 +37,7 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean private String beanId; private LoggingFeature loggingFeature; private int loggingSizeLimit; +private boolean performInvocation; public SpringJAXRSServerFactoryBean() { } @@ -113,4 +115,20 @@ public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); } } + +@Override +protected boolean isValidClassResourceInfo(ClassResourceInfo cri) { +// CXF will consider interfaces created for managing model resources +// invalid - however it is fine with Camel processors if no service invocation +// is requested. +return !isPerformInvocation() || !cri.getServiceClass().isInterface(); +} + +public boolean isPerformInvocation() { +return performInvocation; +} + +public void setPerformInvocation(boolean performInvocation) { +this.performInvocation = performInvocation; +} }
[camel-spring-boot] 01/07: some clean up
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit 01360d8be9c63717521e3b90b5910e54d11ad0d6 Author: Freeman Fang AuthorDate: Tue Dec 20 16:10:36 2022 -0500 some clean up (cherry picked from commit eb628065848af5eca1120d0c0500f5ae2b1b45b1) --- components-starter/camel-cxf-rest-starter/pom.xml | 11 +- .../cxf/jaxrs/testbean/CustomException.java| 27 .../component/cxf/jaxrs/testbean/Customer.java | 75 -- .../cxf/jaxrs/testbean/CustomerService.java| 153 - .../testbean/CustomerServiceNoAnnotations.java | 25 .../jaxrs/testbean/CustomerServiceResource.java| 51 --- .../component/cxf/jaxrs/testbean/EchoService.java | 41 -- .../camel/component/cxf/jaxrs/testbean/Order.java | 67 - .../component/cxf/jaxrs/testbean/Product.java | 41 -- .../component/cxf/jaxrs/testbean/ServiceUtil.java | 24 .../rest/springboot/CxfRsConsumerWithBeanTest.java | 24 ++-- .../rest/springboot/CxfRsProducerSessionTest.java | 5 +- .../cxf/rest/springboot/CxfRsStreamCacheTest.java | 7 +- .../routes/CxfRsSpringProducerSession.xml | 4 +- 14 files changed, 31 insertions(+), 524 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index a8f6000d351..84d470494c8 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -40,16 +40,17 @@ ${camel-version} - org.apache.cxf - cxf-rt-transports-http-undertow - ${cxf-version} - test + org.apache.camel + camel-cxf-common + ${camel-version} + test-jar org.apache.camel - camel-cxf-common + camel-cxf-spring-rest ${camel-version} test-jar + test org.apache.camel diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomException.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomException.java deleted file mode 100644 index 1b34d8d6bf5..000 --- a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomException.java +++ /dev/null @@ -1,27 +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. - */ -package org.apache.camel.component.cxf.jaxrs.testbean; - -public class CustomException extends Exception { - -private static final long serialVersionUID = 1L; - -public CustomException(String message) { -super(message); -} - -} diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java deleted file mode 100644 index e0b740c8761..000 --- a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java +++ /dev/null @@ -1,75 +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. - */ -package org.apache.camel.component.cxf.jaxrs.testbean; - -import javax.xml.b
[camel-spring-boot] 06/07: add CxfRsAsyncProducerTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit e1fdba4283579c5e739039380354fb5fba298de1 Author: Freeman Fang AuthorDate: Thu Jan 19 11:45:12 2023 -0500 add CxfRsAsyncProducerTest (cherry picked from commit d97ee6391e950395e59276fcefba7dbea09d351d) --- .../rest/springboot/CxfRsAsyncProducerTest.java| 640 + .../springboot/CxfRsGlobalSslProducerTest.java | 13 +- .../rest/springboot/CxfRsProducerHeaderTest.java | 13 +- .../rest/springboot/CxfRsSslAsyncProducerTest.java | 13 +- .../cxf/rest/springboot/CxfRsSslProducerTest.java | 13 +- 5 files changed, 687 insertions(+), 5 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerTest.java new file mode 100644 index 000..34b38c8b2c9 --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerTest.java @@ -0,0 +1,640 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import javax.ws.rs.core.Response; + + +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.CxfOperationException; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.jaxrs.testbean.Customer; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSClientFactoryBean; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSServerFactoryBean; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.xml.CamelEndpointFactoryBean; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.camel.util.CastUtils; +import org.apache.cxf.Bus; +import org.apache.cxf.endpoint.Client; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.feature.Feature; +import org.apache.cxf.interceptor.InterceptorProvider; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.jaxrs.utils.ParameterizedCollectionType; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsAsyncProducerTest.class, +CxfRsAsyncProducerTest.Tes
[camel-spring-boot] 07/07: add CxfRsAsyncProducerSessionTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit f4c26e12b3f7eccc8e700a3a2cc7dd570ac299ba Author: Freeman Fang AuthorDate: Fri Jan 20 17:07:42 2023 -0500 add CxfRsAsyncProducerSessionTest --- .../springboot/CxfRsAsyncProducerSessionTest.java | 234 + 1 file changed, 234 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerSessionTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerSessionTest.java new file mode 100644 index 000..398fed5c6b0 --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsAsyncProducerSessionTest.java @@ -0,0 +1,234 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.util.ArrayList; +import java.util.List; + + + +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSClientFactoryBean; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSServerFactoryBean; +import org.apache.camel.http.base.cookie.BaseCookieHandler; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.xml.CamelEndpointFactoryBean; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsAsyncProducerSessionTest.class, +CxfRsAsyncProducerSessionTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT +) +public class CxfRsAsyncProducerSessionTest { + +static int port1 = CXFTestSupport.getPort1(); +static int port2 = CXFTestSupport.getPort2(); + +private Server server; + +@Autowired +private ProducerTemplate template; + + + +@BeforeEach +public void setUp() throws Exception { +JAXRSServerFactoryBean sfb = new SpringJAXRSServerFactoryBean(); +List serviceBeans = new ArrayList(); +serviceBeans.add(new org.apache.camel.component.cxf.jaxrs.testbean.EchoService()); +sfb.setServiceBeans(serviceBeans); +sfb.setAddress("/CxfRsProducerSessionTest/"); +sfb.setStaticSubresourceResolution(true); +server = sfb.create(); +server.start(); +} + +@AfterEach +public void shutdown() throws Exception { +if (server != null) { +server.stop(); +server.destroy(); +} +} +
[camel-spring-boot] 03/07: add CxfRsSslProducerTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit 9fa07a6c18a3aa7eb3a6ae9b6d615affee08e06e Author: Freeman Fang AuthorDate: Mon Jan 16 16:33:59 2023 -0500 add CxfRsSslProducerTest (cherry picked from commit f3b673399bdd8be6ee103c31f9064c1d9a998b47) --- .../cxf/rest/springboot/CxfRsSslProducerTest.java | 261 + .../cxf/rest/springboot/SslBuilderCustomizer.java | 247 +++ 2 files changed, 508 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslProducerTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslProducerTest.java new file mode 100644 index 000..ecd97ec46d9 --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslProducerTest.java @@ -0,0 +1,261 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + + + +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.jaxrs.testbean.Customer; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSClientFactoryBean; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.support.jsse.KeyStoreParameters; +import org.apache.camel.support.jsse.SSLContextParameters; +import org.apache.camel.support.jsse.TrustManagersParameters; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.CertificateFileSslStoreProvider; +import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.Ssl.ClientAuth; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; +import org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsSslProducerTest.class, +CxfRsSslProducerTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT +) +public class CxfRsSslProducerTest { + +static int port = CXFTestSupport.getSslPort(); + + +@Autowired +protected ProducerTemplate template; + +@BeforeEach +public void setUp() throws Exception { +JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean(); +List serviceBeans = new ArrayList(); +
[camel-spring-boot] branch more-rest-test-new created (now f4c26e12b3f)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git at f4c26e12b3f add CxfRsAsyncProducerSessionTest This branch includes the following new commits: new 01360d8be9c some clean up new a8f8f6e5def add CxfRsProducerHeaderTest new 9fa07a6c18a add CxfRsSslProducerTest new 5ae525d0867 add CxfRsGlobalSslProducerTest new acdcd1f5bef add CxfRsSslAsyncProducerTest new e1fdba42835 add CxfRsAsyncProducerTest new f4c26e12b3f add CxfRsAsyncProducerSessionTest The 7 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[camel-spring-boot] 05/07: add CxfRsSslAsyncProducerTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit acdcd1f5bef7c9051c4afadf34647ed67dc99f92 Author: Freeman Fang AuthorDate: Wed Jan 18 16:36:00 2023 -0500 add CxfRsSslAsyncProducerTest (cherry picked from commit 1702841dd0774b852a1d3a9aa9281f58639c6eab) --- .../rest/springboot/CxfRsSslAsyncProducerTest.java | 261 + 1 file changed, 261 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslAsyncProducerTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslAsyncProducerTest.java new file mode 100644 index 000..dbcf0247d2c --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsSslAsyncProducerTest.java @@ -0,0 +1,261 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + + + +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.jaxrs.testbean.Customer; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSClientFactoryBean; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.support.jsse.KeyStoreParameters; +import org.apache.camel.support.jsse.SSLContextParameters; +import org.apache.camel.support.jsse.TrustManagersParameters; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.CertificateFileSslStoreProvider; +import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.Ssl.ClientAuth; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; +import org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsSslAsyncProducerTest.class, +CxfRsSslAsyncProducerTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT +) +public class CxfRsSslAsyncProducerTest { + +static int port = CXFTestSupport.getSslPort(); + + +@Autowired +protected ProducerTemplate template; + +@BeforeEach +public void setUp() throws Exception { +JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean(); +List serviceBeans = new ArrayList(); +serviceBeans.add(new org.apache.camel.component.cxf.jaxrs.test
[camel-spring-boot] 04/07: add CxfRsGlobalSslProducerTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit 5ae525d086749666bd5701362b938fc130c48c4d Author: Freeman Fang AuthorDate: Wed Jan 18 15:14:13 2023 -0500 add CxfRsGlobalSslProducerTest (cherry picked from commit 43a46af853850b6d32750fb71928073a0c7b8e3e) --- .../springboot/CxfRsGlobalSslProducerTest.java | 257 + 1 file changed, 257 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsGlobalSslProducerTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsGlobalSslProducerTest.java new file mode 100644 index 000..3a0e4ff6c04 --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsGlobalSslProducerTest.java @@ -0,0 +1,257 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.SSLContextParametersAware; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.jaxrs.testbean.Customer; +import org.apache.camel.component.cxf.spring.jaxrs.SpringJAXRSClientFactoryBean; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.CamelContextConfiguration; +import org.apache.camel.support.jsse.KeyStoreParameters; +import org.apache.camel.support.jsse.SSLContextParameters; +import org.apache.camel.support.jsse.TrustManagersParameters; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.server.CertificateFileSslStoreProvider; +import org.springframework.boot.web.server.Ssl; +import org.springframework.boot.web.server.Ssl.ClientAuth; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; +import org.apache.cxf.transport.https.httpclient.DefaultHostnameVerifier; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsGlobalSslProducerTest.class, +CxfRsGlobalSslProducerTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT +) +public class CxfRsGlobalSslProducerTest { + +static int port = CXFTestSupport.getSslPort(); + + +@Autowired +protected ProducerTemplate template; + +@BeforeEach +public void setUp() throws Exception { +JAXRSServerFactoryBean sfb = new JA
[camel-spring-boot] 02/07: add CxfRsProducerHeaderTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch more-rest-test-new in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit a8f8f6e5def798139c41ac2bf2b5c713d640d282 Author: Freeman Fang AuthorDate: Wed Jan 11 13:44:01 2023 -0500 add CxfRsProducerHeaderTest (cherry picked from commit 95baaf79e0e9c886f6af2ce405506d9200373ca5) --- components-starter/camel-cxf-rest-starter/pom.xml | 16 ++ .../rest/springboot/CxfRsProducerHeaderTest.java | 235 + 2 files changed, 251 insertions(+) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index 84d470494c8..f70625763b3 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -58,6 +58,12 @@ ${camel-version} test + + org.apache.camel.springboot + camel-jetty-starter + ${camel-version} + test + cglib cglib-nodep @@ -93,4 +99,14 @@ + + + +maven-surefire-plugin + + 0 + + + + diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsProducerHeaderTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsProducerHeaderTest.java new file mode 100644 index 000..47bcf5063c2 --- /dev/null +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsProducerHeaderTest.java @@ -0,0 +1,235 @@ +/* + * 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.component.cxf.rest.springboot; + + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.Response; + + +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.CXFTestSupport; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.component.cxf.util.CxfUtils; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.xml.CamelEndpointFactoryBean; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; + + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CxfRsProducerHeaderTest.class, +CxfRsProducerHeaderTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT +) +public class CxfRsProducerHeaderTest { + +static int port2 = CXFTestSupport.getPort2(); +static int port3 = CXFTestSupport.getPort("CxfRsProducerHeaderTest.1"); + +private static final Object RESPONSE = "" + + "123John"; + +@
[camel] branch camel-3.18.x updated: [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 44995b07f46 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest 44995b07f46 is described below commit 44995b07f46334d3dd27c6754cc028123d378ffd Author: Freeman Fang AuthorDate: Fri Jan 20 12:22:02 2023 -0500 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest (cherry picked from commit 84702a1da3984840a41f205a30c434a27e855a53) (cherry picked from commit a346af2c3e2fb36bb1942f5b7fe0310aa481b284) --- .../apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java | 4 +++- components/camel-cxf/camel-cxf-spring-rest/pom.xml | 16 .../component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java | 2 ++ .../cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java | 4 +--- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java index 09711197e16..778f20e2b2a 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java @@ -154,6 +154,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate public CxfRsEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); @@ -695,7 +697,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate * Set the feature list to the CxfRs endpoint. */ public void setFeatures(List features) { -this.features = features; +this.features = new ArrayList(features); } public Map getProperties() { diff --git a/components/camel-cxf/camel-cxf-spring-rest/pom.xml b/components/camel-cxf/camel-cxf-spring-rest/pom.xml index 8a27a8831ee..13ccd3a30d8 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-rest/pom.xml @@ -298,6 +298,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java index 9d6d5515bd7..3697f7816e0 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java @@ -35,6 +35,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware { public CxfRsSpringEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); init(bean); diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java index 0d86e25fce9..5f425439f16 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java @@ -26,7 +26,6 @@ import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.junit.jupiter.api.Disabled; import
[camel] branch camel-3.20.x updated: [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.20.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.20.x by this push: new a346af2c3e2 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest a346af2c3e2 is described below commit a346af2c3e2fb36bb1942f5b7fe0310aa481b284 Author: Freeman Fang AuthorDate: Fri Jan 20 12:22:02 2023 -0500 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest (cherry picked from commit 84702a1da3984840a41f205a30c434a27e855a53) --- .../apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java | 4 +++- components/camel-cxf/camel-cxf-spring-rest/pom.xml | 16 .../component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java | 2 ++ .../cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java | 4 +--- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java index 09711197e16..778f20e2b2a 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java @@ -154,6 +154,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate public CxfRsEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); @@ -695,7 +697,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate * Set the feature list to the CxfRs endpoint. */ public void setFeatures(List features) { -this.features = features; +this.features = new ArrayList(features); } public Map getProperties() { diff --git a/components/camel-cxf/camel-cxf-spring-rest/pom.xml b/components/camel-cxf/camel-cxf-spring-rest/pom.xml index 42f1f569969..bff6022bbe3 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-rest/pom.xml @@ -298,6 +298,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java index 9d6d5515bd7..3697f7816e0 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java @@ -35,6 +35,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware { public CxfRsSpringEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); init(bean); diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java index 0d86e25fce9..5f425439f16 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java @@ -26,7 +26,6 @@ import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static
[camel] branch main updated: [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest
This is an automated email from the ASF dual-hosted git repository. ffang 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 84702a1da39 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest 84702a1da39 is described below commit 84702a1da3984840a41f205a30c434a27e855a53 Author: Freeman Fang AuthorDate: Fri Jan 20 12:22:02 2023 -0500 [CAMEL-18960]fix up CxfRsEndpointWithPropertiesTest --- .../apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java | 4 +++- components/camel-cxf/camel-cxf-spring-rest/pom.xml | 16 .../component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java | 2 ++ .../cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java | 4 +--- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java index 09711197e16..778f20e2b2a 100644 --- a/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java +++ b/components/camel-cxf/camel-cxf-rest/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java @@ -154,6 +154,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate public CxfRsEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); @@ -695,7 +697,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate * Set the feature list to the CxfRs endpoint. */ public void setFeatures(List features) { -this.features = features; +this.features = new ArrayList(features); } public Map getProperties() { diff --git a/components/camel-cxf/camel-cxf-spring-rest/pom.xml b/components/camel-cxf/camel-cxf-spring-rest/pom.xml index c8c7329844a..01eb54037c6 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-rest/pom.xml @@ -243,6 +243,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java index 9d6d5515bd7..3697f7816e0 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/main/java/org/apache/camel/component/cxf/spring/jaxrs/CxfRsSpringEndpoint.java @@ -35,6 +35,8 @@ public class CxfRsSpringEndpoint extends CxfRsEndpoint implements BeanIdAware { public CxfRsSpringEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) { super(uri, component); setAddress(bean.getAddress()); +setFeatures(bean.getFeatures()); +setProperties(bean.getProperties()); // Update the sfb address by resolving the properties bean.setAddress(getAddress()); init(bean); diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java index 0d86e25fce9..5f425439f16 100644 --- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java +++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithPropertiesTest.java @@ -26,7 +26,6 @@ import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -39,7 +38,6 @@ public class CxfRsEndpointWithPropertiesTest extends
[camel] branch main updated: fix up MTOM doc for camel-cxf-soap
This is an automated email from the ASF dual-hosted git repository. ffang 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 f7a71059569 fix up MTOM doc for camel-cxf-soap f7a71059569 is described below commit f7a7105956986652a24211e0174335be0a6f627d Author: Freeman Fang AuthorDate: Fri Jan 13 12:19:18 2023 -0500 fix up MTOM doc for camel-cxf-soap --- .../src/main/docs/cxf-component.adoc | 126 +++-- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index abc17279f7e..8a4e2b4705b 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -913,17 +913,16 @@ possible to retrieve attachments by Camel Message API [source,java] -DataHandler Message.getAttachment(String id) +DataHandler Exchange.getIn(AttachmentMessage.class).getAttachment(String id) -*Payload Mode:* MTOM is supported by the component. Attachments can be +*Payload Mode:* MTOM is supported by this Mode. Attachments can be retrieved by Camel Message APIs mentioned above. SOAP with Attachment (SwA) is supported and attachments can be retrieved. SwA is the default (same as setting the CXF endpoint property "mtom-enabled" to false). To enable MTOM, set the CXF endpoint property "mtom-enabled" to _true_. -(I believe you can only do it with Spring.) [source,xml] @@ -957,45 +956,45 @@ Exchange exchange = context.createProducerTemplate().send("direct:testEndpoint", CxfPayload body = new CxfPayload(new ArrayList(), elements, null); exchange.getIn().setBody(body); -exchange.getIn().addAttachment(MtomTestHelper.REQ_PHOTO_CID, + exchange.getIn(AttachmentMessage.class).addAttachment(MtomTestHelper.REQ_PHOTO_CID, new DataHandler(new ByteArrayDataSource(MtomTestHelper.REQ_PHOTO_DATA, "application/octet-stream"))); -exchange.getIn().addAttachment(MtomTestHelper.REQ_IMAGE_CID, + exchange.getIn(AttachmentMessage.class).addAttachment(MtomTestHelper.REQ_IMAGE_CID, new DataHandler(new ByteArrayDataSource(MtomTestHelper.requestJpeg, "image/jpeg"))); } }); -// process response +// process response -CxfPayload out = exchange.getOut().getBody(CxfPayload.class); -Assert.assertEquals(1, out.getBody().size()); +CxfPayload out = exchange.getMessage().getBody(CxfPayload.class); +assertEquals(1, out.getBody().size()); -Map ns = new HashMap(); +Map ns = new HashMap<>(); ns.put("ns", MtomTestHelper.SERVICE_TYPES_NS); ns.put("xop", MtomTestHelper.XOP_NS); XPathUtils xu = new XPathUtils(ns); Element oute = new XmlConverter().toDOMElement(out.getBody().get(0)); -Element ele = (Element)xu.getValue("//ns:DetailResponse/ns:photo/xop:Include", oute, - XPathConstants.NODE); +Element ele = (Element) xu.getValue("//ns:DetailResponse/ns:photo/xop:Include", oute, +XPathConstants.NODE); String photoId = ele.getAttribute("href").substring(4); // skip "cid:" -ele = (Element)xu.getValue("//ns:DetailResponse/ns:image/xop:Include", oute, - XPathConstants.NODE); +ele = (Element) xu.getValue("//ns:DetailResponse/ns:image/xop:Include", oute, +XPathConstants.NODE); String imageId = ele.getAttribute("href").substring(4); // skip "cid:" -DataHandler dr = exchange.getOut().getAttachment(photoId); -Assert.assertEquals("application/octet-stream", dr.getContentType()); -MtomTestHelper.assertEquals(MtomTestHelper.RESP_PHOTO_DATA, IOUtils.readBytesFromStream(dr.getInputStream())); +DataHandler dr = exchange.getMessage(AttachmentMessage.class).getAttachment(decodingReference(photoId)); +assertEquals("application/octet-stream", dr.getContentType()); +assertArrayEquals(MtomTestHelper.RESP_PHOTO_DATA, IOUtils.readBytesFromStream(dr.getInputStream())); -dr = exchange.getOut().getAttachment(imageId); -Assert.assertEquals("image/jpeg", dr.getContentType()); +dr = exchange.getMessage(AttachmentMessage.class).getAttachment(decodingReference(imageId)); +assertEquals("image/jpeg", dr.getContentType()); BufferedImage image = ImageIO.read(dr.getInputStream()); -Assert.assertEquals(560, image.getWidth()); -Assert.assertEquals(300, image.getHeight()); +assertEquals(560, image.getWidth()); +assertEquals(300, image.getHeight()); You can also consume a Camel message r
[camel] branch main updated: fix up MTOM POJO dataformat doc for camel-cxf-soap
This is an automated email from the ASF dual-hosted git repository. ffang 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 637a51bec51 fix up MTOM POJO dataformat doc for camel-cxf-soap 637a51bec51 is described below commit 637a51bec51118e29be673c5e3cde7f2162a039c Author: Freeman Fang AuthorDate: Fri Jan 13 10:58:10 2023 -0500 fix up MTOM POJO dataformat doc for camel-cxf-soap --- .../camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc index 8011a0c58a2..abc17279f7e 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc +++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc @@ -905,12 +905,10 @@ response context with the following code: == Attachment Support -*POJO Mode:* Both SOAP with Attachment and MTOM are supported (see -example in Payload Mode for enabling MTOM). However, SOAP with -Attachment is not tested. Since attachments are marshalled and -unmarshalled into POJOs, users typically do not need to deal with the -attachment themself. Attachments are propagated to Camel message's -attachments if the MTOM is not enabled. So, it is +*POJO Mode:* MTOM are supported if is enabled(see +example in Payload Mode for enabling MTOM). Since attachments are +marshalled and unmarshalled into POJOs, the attachments should be +retrieved from Camel Message Body(As parameter list), and it isn't possible to retrieve attachments by Camel Message API [source,java]
[camel-spring-boot] branch main updated: [CAMEL-18729]update WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY in the WSRMTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new c38b36b45dd [CAMEL-18729]update WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY in the WSRMTest c38b36b45dd is described below commit c38b36b45dd345800db743e14ed6d131bfc09b5f Author: Freeman Fang AuthorDate: Thu Dec 8 12:27:38 2022 -0500 [CAMEL-18729]update WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY in the WSRMTest --- .../org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java index 2c11e7a6632..5d99fcf9885 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java @@ -115,7 +115,7 @@ public class WSRMTest { Client client = ClientProxy.getClient(helloWorld); String decoupledEndpoint = "/wsrm/decoupled_endpoint"; client.getBus().setProperty(WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY, - "http://localhost:"; + port + "/services/wsrm/decoupled_endpoint"); + "http://localhost:"; + port + "/services"); HTTPConduit hc = (HTTPConduit)(client.getConduit()); HTTPClientPolicy cp = hc.getClient(); cp.setDecoupledEndpoint(decoupledEndpoint);
[camel-spring-boot] branch main updated: [CAMEL-18783]test scenarios in CSB
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 8e81bdd187b [CAMEL-18783]test scenarios in CSB 8e81bdd187b is described below commit 8e81bdd187b6b40b659d763671755c95815e1a68 Author: Freeman Fang AuthorDate: Thu Dec 8 12:06:18 2022 -0500 [CAMEL-18783]test scenarios in CSB --- .../{CxfTimeoutTest.java => CxfBeanScopeTest.java} | 57 ++ .../cxf/soap/springboot/CxfTimeoutTest.java| 2 + .../soap/headers/CxfMessageHeadersRelayTest.java | 3 ++ .../cxf/soap/springboot/wsdl/CxfWsdlFirstTest.java | 2 + 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java similarity index 81% copy from components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java copy to components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java index 747cf58b95a..6e6b0bd4183 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfTimeoutTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/CxfBeanScopeTest.java @@ -27,6 +27,7 @@ import javax.xml.ws.Endpoint; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ProducerTemplate; +import org.apache.camel.ResolveEndpointFailedException; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.cxf.GreeterImplWithSleep; import org.apache.camel.component.cxf.common.CXFTestSupport; @@ -45,6 +46,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -52,6 +54,7 @@ import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFa import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; import org.springframework.test.annotation.DirtiesContext; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; import org.apache.cxf.endpoint.Client; @@ -65,11 +68,11 @@ import org.apache.hello_world_soap_http.Greeter; @DirtiesContext @CamelSpringBootTest @SpringBootTest(classes = { - CamelAutoConfiguration.class, CxfTimeoutTest.class, - CxfTimeoutTest.TestConfiguration.class, + CamelAutoConfiguration.class, CxfBeanScopeTest.class, + CxfBeanScopeTest.TestConfiguration.class, CxfAutoConfiguration.class }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CxfTimeoutTest { +public class CxfBeanScopeTest { static int port = CXFTestSupport.getPort1();; @@ -94,30 +97,35 @@ public class CxfTimeoutTest { + @Test -public void testInvokingJaxWsServerWithBusUriParams() throws Exception { -sendTimeOutMessage("cxf://" + JAXWS_SERVER_ADDRESS + "?serviceClass=org.apache.hello_world_soap_http.Greeter&bus=#cxf&cxfConfigurer=#origConfigurer"); +public void testSingltonScopeWithConflict() throws Exception { +try { +sendTimeOutMessage("cxf://bean:springEndpoint"); +fail("Should get the Exception here."); +} catch (ResolveEndpointFailedException ex) { +assertTrue(ex.getMessage().contains( +"Different URI refer to the same CxfEndpoint Bean instance")); +} } - + @Test -public void testInvokingJaxWsServerWithoutBusUriParams() throws Exception { -sendTimeOutMessage("cxf://" + JAXWS_SERVER_ADDRESS + "?serviceClass=org.apache.hello_world_soap_http.Greeter&cxfConfigurer=#origConfigurer"); +public void testSingltonScopeWithoutConflict() throws Exception { + sendTimeOutMessage("cxf://bean:springEndpoint?sslContextParameters=#mySslContext&hostnameVerifier=#defaultHostnameVerifier"); } - + @Test -public void testInvokingJaxWsServerWithCxfEndpo
[camel] branch main updated (5fd8af3fe0d -> 701f09b8a15)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/camel.git from 5fd8af3fe0d (chores) camel-kafka: added invalid auth handling tests add 701f09b8a15 [CAMEL-18783]camel-cxf - avoid referring Singleton bean instance(CxfEndpoint) while changing its state in different URIs No new revisions were added by this update. Summary of changes: .../camel/component/cxf/jaxws/CxfComponent.java| 30 -- 1 file changed, 28 insertions(+), 2 deletions(-)
[camel-spring-boot] branch main updated: [CAMEL-18729]use platform servlet transport for the ws-rm|ws-addressing decoupled endpoint at client side, instead of an embeded http server(another listening
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 808a0460d62 [CAMEL-18729]use platform servlet transport for the ws-rm|ws-addressing decoupled endpoint at client side, instead of an embeded http server(another listening port other than the platform servlet listening port) 808a0460d62 is described below commit 808a0460d62b7b978619e601d6f4f825db35b374 Author: Freeman Fang AuthorDate: Wed Dec 7 10:56:44 2022 -0500 [CAMEL-18729]use platform servlet transport for the ws-rm|ws-addressing decoupled endpoint at client side, instead of an embeded http server(another listening port other than the platform servlet listening port) --- .../component/cxf/soap/springboot/wsrm/WSRMTest.java | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java index f6cfbdc7316..2c11e7a6632 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/wsrm/WSRMTest.java @@ -55,6 +55,7 @@ import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; import org.apache.cxf.testutil.common.TestUtil; import org.apache.cxf.transport.http.HTTPConduit; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +import org.apache.cxf.ws.addressing.WSAContextUtils; import org.apache.cxf.ws.rm.manager.AcksPolicyType; import org.apache.cxf.ws.rm.manager.DestinationPolicyType; import org.apache.cxf.ws.rmp.v200502.RMAssertion; @@ -112,16 +113,16 @@ public class WSRMTest { proxyFactory.getOutInterceptors().add(new MessageLossSimulator()); HelloWorld helloWorld = (HelloWorld) proxyFactory.create(); Client client = ClientProxy.getClient(helloWorld); -String decoupledEndpoint = "http://localhost:"; -+ TestUtil.getPortNumber("decoupled") + "/wsrm/decoupled_endpoint"; - +String decoupledEndpoint = "/wsrm/decoupled_endpoint"; + client.getBus().setProperty(WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY, + "http://localhost:"; + port + "/services/wsrm/decoupled_endpoint"); HTTPConduit hc = (HTTPConduit)(client.getConduit()); HTTPClientPolicy cp = hc.getClient(); cp.setDecoupledEndpoint(decoupledEndpoint); -String result = helloWorld.sayHi("world!"); -assertEquals("Hello world!", result, "Get a wrong response"); -result = helloWorld.sayHi("world!");//second call will trigger MessageLoss and resend -assertEquals("Hello world!", result, "Get a wrong response"); +String result = helloWorld.sayHi("world1!"); +assertEquals("Hello world1!", result, "Get a wrong response"); +result = helloWorld.sayHi("world2!");//second call will trigger MessageLoss and resend +assertEquals("Hello world2!", result, "Get a wrong response"); } // *
[camel-spring-boot] branch camel-spring-boot-3.18.x updated: [CAMEL-18729]fix NoParamTest failure
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.18.x by this push: new 10fa3c1084e [CAMEL-18729]fix NoParamTest failure 10fa3c1084e is described below commit 10fa3c1084e5ddfc020953b0c7e802c0774c2ab4 Author: Freeman Fang AuthorDate: Fri Nov 25 10:21:19 2022 -0500 [CAMEL-18729]fix NoParamTest failure (cherry picked from commit 117bc0168e0ec71f3ece9226523a6c76a24a813d) --- .../cxf/soap/springboot/noparam/NoParamTest.java | 23 +++--- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java index cd9d9f46660..bb9e55f31de 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java @@ -18,7 +18,6 @@ package org.apache.camel.component.cxf.soap.springboot.noparam; -import javax.xml.ws.Endpoint; import org.apache.camel.ExchangePattern; import org.apache.camel.ProducerTemplate; @@ -35,7 +34,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -63,14 +61,7 @@ public class NoParamTest { static int port = CXFTestSupport.getPort1(); -@BeforeEach -public void setup() { -Object implementor = new org.apache.camel.component.cxf.noparam.NoParamEndpoint(); -String address = "/cxf-noparam/"; -Endpoint.publish(address, implementor); -} - - + @Autowired @@ -104,6 +95,15 @@ public class NoParamTest { return cxfEndpoint; } +@Bean +CxfEndpoint noParamServiceEndpoint() { +CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint(); + cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.noparam.NoParamEndpoint.class); +cxfEndpoint.setAddress("http://localhost:"; + port + + "/services/camel-noparam/"); +return cxfEndpoint; +} + @Bean public RouteBuilder routeBuilder() { return new RouteBuilder() { @@ -114,8 +114,7 @@ public class NoParamTest { .to("mock:end"); from("direct:noParam") -.to("cxf:bean:noParamEndpoint?address=" + "http://localhost:"; + port -+ "/services/camel-noparam/"); +.to("cxf:bean:noParamServiceEndpoint"); } }; }
[camel-spring-boot] branch main updated: [CAMEL-18729]fix NoParamTest failure
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 117bc0168e0 [CAMEL-18729]fix NoParamTest failure 117bc0168e0 is described below commit 117bc0168e0ec71f3ece9226523a6c76a24a813d Author: Freeman Fang AuthorDate: Fri Nov 25 10:21:19 2022 -0500 [CAMEL-18729]fix NoParamTest failure --- .../cxf/soap/springboot/noparam/NoParamTest.java | 23 +++--- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java index cd9d9f46660..bb9e55f31de 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/noparam/NoParamTest.java @@ -18,7 +18,6 @@ package org.apache.camel.component.cxf.soap.springboot.noparam; -import javax.xml.ws.Endpoint; import org.apache.camel.ExchangePattern; import org.apache.camel.ProducerTemplate; @@ -35,7 +34,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -63,14 +61,7 @@ public class NoParamTest { static int port = CXFTestSupport.getPort1(); -@BeforeEach -public void setup() { -Object implementor = new org.apache.camel.component.cxf.noparam.NoParamEndpoint(); -String address = "/cxf-noparam/"; -Endpoint.publish(address, implementor); -} - - + @Autowired @@ -104,6 +95,15 @@ public class NoParamTest { return cxfEndpoint; } +@Bean +CxfEndpoint noParamServiceEndpoint() { +CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint(); + cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.noparam.NoParamEndpoint.class); +cxfEndpoint.setAddress("http://localhost:"; + port + + "/services/camel-noparam/"); +return cxfEndpoint; +} + @Bean public RouteBuilder routeBuilder() { return new RouteBuilder() { @@ -114,8 +114,7 @@ public class NoParamTest { .to("mock:end"); from("direct:noParam") -.to("cxf:bean:noParamEndpoint?address=" + "http://localhost:"; + port -+ "/services/camel-noparam/"); +.to("cxf:bean:noParamServiceEndpoint"); } }; }
[camel] branch camel-3.19.x updated: Revert "[CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter"
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.19.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.19.x by this push: new 1a1e07b1ad5 Revert "[CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter" 1a1e07b1ad5 is described below commit 1a1e07b1ad599cd95d9b56d892b305101e6bae4e Author: Freeman Fang AuthorDate: Thu Nov 24 08:57:59 2022 -0500 Revert "[CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter" This reverts commit 03d171ae0d9e3e9fc64c33ce8f17ee936cda563d. --- components/camel-cxf/camel-cxf-soap/pom.xml| 16 components/camel-cxf/camel-cxf-spring-soap/pom.xml | 16 2 files changed, 32 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/pom.xml b/components/camel-cxf/camel-cxf-soap/pom.xml index 872fcc05a54..1702bb6c009 100644 --- a/components/camel-cxf/camel-cxf-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-soap/pom.xml @@ -280,22 +280,6 @@ - - -maven-jar-plugin - - - -test-jar - - - - - -log4j2.properties - - - maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-soap/pom.xml b/components/camel-cxf/camel-cxf-spring-soap/pom.xml index 7f8287463b4..769e9d05ebf 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-soap/pom.xml @@ -296,22 +296,6 @@ - - -maven-jar-plugin - - - -test-jar - - - - - -log4j2.properties - - - maven-surefire-plugin
[camel-spring-boot] branch camel-spring-boot-3.18.x updated: [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.18.x by this push: new 1eebb645ce1 [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest 1eebb645ce1 is described below commit 1eebb645ce17df2e537c6701a07d4a32d3849450 Author: Freeman Fang AuthorDate: Thu Nov 24 08:56:37 2022 -0500 [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest (cherry picked from commit 892d726989fdeff7cf8bd751c71c63d8f413927a) --- .../namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java index 189dab3e4e8..20654d68529 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java @@ -74,7 +74,7 @@ public class CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest extends CxfPay // easier .convertBodyTo(String.class); // This route just returns the test message - from("cxf:bean:serviceEndpoint?dataFormat=RAW").setBody().constant(RESPONSE_MESSAGE); + from("cxf:bean:routerEndpoint?dataFormat=RAW").setBody().constant(RESPONSE_MESSAGE); } }; }
[camel-spring-boot] branch main updated: [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 892d726989f [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest 892d726989f is described below commit 892d726989fdeff7cf8bd751c71c63d8f413927a Author: Freeman Fang AuthorDate: Thu Nov 24 08:56:37 2022 -0500 [CAMEL-18729]fix CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest --- .../namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java index 189dab3e4e8..20654d68529 100644 --- a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/soap/springboot/namespace/CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest.java @@ -74,7 +74,7 @@ public class CxfPayloadProducerNamespaceOnEnvelopeStreamCacheTest extends CxfPay // easier .convertBodyTo(String.class); // This route just returns the test message - from("cxf:bean:serviceEndpoint?dataFormat=RAW").setBody().constant(RESPONSE_MESSAGE); + from("cxf:bean:routerEndpoint?dataFormat=RAW").setBody().constant(RESPONSE_MESSAGE); } }; }
[camel-spring-boot] 01/02: ✅ CXF Simple JAAS Test (#593)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git commit f144eed1d1fd4ae52bdab4dcd03b5ea7ba88e1a6 Author: Federico Mariani <34543311+cro...@users.noreply.github.com> AuthorDate: Thu Jul 28 07:33:47 2022 +0200 ✅ CXF Simple JAAS Test (#593) (cherry picked from commit 421e9cfacded78c26384be75c17edb30e27b16ee) --- components-starter/camel-cxf-soap-starter/pom.xml | 5 + .../component/cxf/security/GreetingService.java| 25 + .../cxf/security/GreetingServiceImpl.java | 28 + .../cxf/security/jaas/SimpleLoginModule.java | 104 ++ .../soap/springboot/WSSUsernameTokenHandler.java | 85 ++ .../cxf/soap/springboot/WSSUsernameTokenTest.java | 122 + .../src/test/resources/routes/soap-security.xml| 49 + .../src/test/resources/simple-jaas.conf| 19 .../springboot/MllpMaxConcurrentConsumersTest.java | 2 +- .../MllpTcpClientProducerConnectionErrorTest.java | 3 - 10 files changed, 438 insertions(+), 4 deletions(-) diff --git a/components-starter/camel-cxf-soap-starter/pom.xml b/components-starter/camel-cxf-soap-starter/pom.xml index 614681087ba..11bdee34a66 100644 --- a/components-starter/camel-cxf-soap-starter/pom.xml +++ b/components-starter/camel-cxf-soap-starter/pom.xml @@ -45,6 +45,11 @@ ${cxf-version} test + + org.apache.cxf + cxf-rt-ws-security + test + org.apache.camel camel-cxf-common diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingService.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingService.java new file mode 100644 index 000..d6312cc7988 --- /dev/null +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingService.java @@ -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. + */ +package org.apache.camel.component.cxf.security; + +import javax.jws.WebService; + +@WebService +public interface GreetingService { + + String greet(String name); +} diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingServiceImpl.java b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingServiceImpl.java new file mode 100644 index 000..7e84b17865a --- /dev/null +++ b/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/GreetingServiceImpl.java @@ -0,0 +1,28 @@ +/* + * 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.component.cxf.security; + +import javax.jws.WebService; + +@WebService(endpointInterface = "org.apache.camel.component.cxf.security.GreetingService") +public class GreetingServiceImpl implements GreetingService { + + @Override + public String greet(String name) { + return "Hello " + name; + } +} diff --git a/components-starter/camel-cxf-soap-starter/src/test/java/org/apache/camel/component/cxf/security/jaas/SimpleLoginModule.java b/components-starter/camel-cxf-soap-
[camel-spring-boot] branch camel-spring-boot-3.18.x updated (8b0eb2a54de -> 8ebcf05fac8)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git from 8b0eb2a54de CAMEL-18746 Add missing debezium db2/oracle starters (#671) new f144eed1d1f ✅ CXF Simple JAAS Test (#593) new 8ebcf05fac8 [CAMEL-18729]add more tests in camel-cxf-soap-starter The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: components-starter/camel-cxf-soap-starter/pom.xml | 81 +- .../GreetingService.java} | 19 +- .../GreetingServiceImpl.java} | 22 +- .../cxf/security/jaas/SimpleLoginModule.java | 104 +++ .../springboot/CxfComponentEnableMtomTest.java | 145 +++ .../soap/springboot/CxfConsumerMessageTest.java| 32 +- .../CxfConsumerPayLoadConverterTest.java | 9 +- .../CxfConsumerPayloadFaultCauseEnabledTest.java | 159 .../soap/springboot/CxfConsumerPayloadTest.java| 38 +- .../soap/springboot/CxfConsumerProviderTest.java | 16 +- .../cxf/soap/springboot/CxfEndpointBeanTest.java | 157 .../springboot/CxfMessageHeaderTimeoutTest.java| 167 .../cxf/soap/springboot/CxfNonWrapperTest.java | 142 +++ .../cxf/soap/springboot/CxfOneWayRouteTest.java| 219 + .../CxfPayLoadMessageXmlBindingRouterTest.java | 177 .../springboot/CxfPayLoadSoapHeaderSpringTest.java | 213 + .../CxfSpringCustomizedExceptionTest.java | 146 +++ .../cxf/soap/springboot/CxfSpringRouterTest.java | 163 .../cxf/soap/springboot/CxfTimeoutTest.java| 266 ++ .../springboot/FileToCxfMessageDataFormatTest.java | 176 .../cxf/soap/springboot/JaxwsTestHandler.java | 82 ++ .../LoggingInterceptorInMessageModeTest.java | 209 + .../cxf/soap/springboot/MultiPartInvokeImpl.java | 52 -- .../cxf/soap/springboot/SpringBusFactoryTest.java | 70 ++ .../converter/PayLoadConvertToPOJOTest.java| 130 +++ .../dispatch/CxfDispatchMessageTest.java | 159 .../dispatch/CxfDispatchPayloadTest.java | 161 .../dispatch/CxfDispatchTestSupport.java | 122 +++ .../dispatch/CxfSoapMessageProviderTest.java | 188 .../greeterroute/AbstractCXFGreeterRouterTest.java | 132 +++ .../greeterroute/CXFGreeterEnrichTest.java | 120 +++ .../greeterroute/CXFGreeterRouterTest.java | 120 +++ .../CxfGreeterCXFMessageRouterTest.java| 113 +++ .../CxfGreeterCXFMessageWithoutSEIRouterTest.java | 118 +++ .../CxfGreeterConverterRouterTest.java | 117 +++ .../CxfGreeterMessageCamelHttpRouterTest.java | 106 +++ .../greeterroute/CxfGreeterMessageRouterTest.java | 113 +++ .../greeterroute/CxfGreeterPayLoadRouterTest.java | 115 +++ .../CxfGreeterPayLoadWithFeatureRouterTest.java| 115 +++ .../greeterroute/CxfGreeterWSDLOnlyRouterTest.java | 113 +++ .../greeterroute/CxfPayloadProviderRouterTest.java | 186 .../springboot/jms/CxfEndpointJMSConsumerTest.java | 127 +++ .../mtom/CxfJavaMtomProducerPayloadTest.java | 104 +++ .../mtom/CxfMtomConsumerMutipleParameterTest.java | 152 .../mtom/CxfMtomConsumerPayloadModeTest.java | 206 + .../soap/springboot/mtom/CxfMtomConsumerTest.java | 168 .../CxfMtomDisabledConsumerPayloadModeTest.java| 192 .../CxfMtomDisabledProducerPayloadModeTest.java| 287 ++ .../springboot/mtom/CxfMtomPOJOProducerTest.java | 192 .../mtom/CxfMtomProducerPayloadModeTest.java | 241 + .../mtom/CxfMtomRouterCxfMessageModeTest.java | 102 +++ .../mtom/CxfMtomRouterPayloadMode12Test.java | 109 +++ .../mtom/CxfMtomRouterPayloadModeTest.java | 214 + .../springboot/mtom/CxfMtomRouterRawModeTest.java | 102 +++ .../ImageService.java} | 31 +- .../cxf/soap/springboot/mtom/MtomTestHelper.java | 102 +++ ...dConsumerDuplicateNamespaceStreamCacheTest.java | 70 ++ ...ConsumerNamespaceOnEnvelopeStreamCacheTest.java | 75 ++ .../CxfPayloadConsumerNamespaceOnEnvelopeTest.java | 150 ...ProducerNamespaceOnEnvelopeStreamCacheTest.java | 84 ++ .../CxfPayloadProducerNamespaceOnEnvelopeTest.java | 151 .../cxf/soap/springboot/noparam/NoParamTest.java | 125 +++ .../soap/headers/CxfMessageHeadersRelayTest.java | 977 + .../{ => springxml}/CXFMultiPartTest.java | 18 +- .../springxml/WSSUsernameTokenHandler.java | 85 ++ .../springboot/springxml/WSSUsernameTokenTest.java | 133 +++ .../soap/springboot/ssl/SslBuilderCustomizer.java | 231 + .../cxf/soap/springboot/ssl/SslGlobalTest.java | 250 ++ .../component/cxf/soap/springboot
[camel] branch camel-3.19.x updated: [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.19.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.19.x by this push: new 03d171ae0d9 [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter 03d171ae0d9 is described below commit 03d171ae0d9e3e9fc64c33ce8f17ee936cda563d Author: Freeman Fang AuthorDate: Fri Nov 18 14:23:40 2022 -0500 [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter (cherry picked from commit 17d7bab23d510aa062ebc067ede2c42a9ba7d564) --- components/camel-cxf/camel-cxf-soap/pom.xml| 16 components/camel-cxf/camel-cxf-spring-soap/pom.xml | 16 2 files changed, 32 insertions(+) diff --git a/components/camel-cxf/camel-cxf-soap/pom.xml b/components/camel-cxf/camel-cxf-soap/pom.xml index 1702bb6c009..872fcc05a54 100644 --- a/components/camel-cxf/camel-cxf-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-soap/pom.xml @@ -280,6 +280,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-soap/pom.xml b/components/camel-cxf/camel-cxf-spring-soap/pom.xml index 769e9d05ebf..7f8287463b4 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-soap/pom.xml @@ -296,6 +296,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin
[camel] branch camel-3.18.x updated: [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new a9d0031f81d [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter a9d0031f81d is described below commit a9d0031f81dbf0bb7b4a4bdece4e997b96db0acc Author: Freeman Fang AuthorDate: Fri Nov 18 14:23:40 2022 -0500 [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter (cherry picked from commit 17d7bab23d510aa062ebc067ede2c42a9ba7d564) (cherry picked from commit 03d171ae0d9e3e9fc64c33ce8f17ee936cda563d) --- components/camel-cxf/camel-cxf-soap/pom.xml| 16 components/camel-cxf/camel-cxf-spring-soap/pom.xml | 16 2 files changed, 32 insertions(+) diff --git a/components/camel-cxf/camel-cxf-soap/pom.xml b/components/camel-cxf/camel-cxf-soap/pom.xml index f9ebee9d90a..c8811ae7aa8 100644 --- a/components/camel-cxf/camel-cxf-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-soap/pom.xml @@ -319,6 +319,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-soap/pom.xml b/components/camel-cxf/camel-cxf-spring-soap/pom.xml index 9b2e363ead8..bb1d85f3dde 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-soap/pom.xml @@ -302,6 +302,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin
[camel] branch main updated: [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter
This is an automated email from the ASF dual-hosted git repository. ffang 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 17d7bab23d5 [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter 17d7bab23d5 is described below commit 17d7bab23d510aa062ebc067ede2c42a9ba7d564 Author: Freeman Fang AuthorDate: Fri Nov 18 14:23:40 2022 -0500 [CAMEL-18729]expose test resources/classes from camel-cxf-soap so that can be reused in camel-cxf-soap-starter --- components/camel-cxf/camel-cxf-soap/pom.xml| 16 components/camel-cxf/camel-cxf-spring-soap/pom.xml | 16 2 files changed, 32 insertions(+) diff --git a/components/camel-cxf/camel-cxf-soap/pom.xml b/components/camel-cxf/camel-cxf-soap/pom.xml index d393bbc953e..18ffebd7220 100644 --- a/components/camel-cxf/camel-cxf-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-soap/pom.xml @@ -280,6 +280,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin diff --git a/components/camel-cxf/camel-cxf-spring-soap/pom.xml b/components/camel-cxf/camel-cxf-spring-soap/pom.xml index 66cf4c4baf4..f93bc71aa47 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/pom.xml +++ b/components/camel-cxf/camel-cxf-spring-soap/pom.xml @@ -296,6 +296,22 @@ + + +maven-jar-plugin + + + +test-jar + + + + + +log4j2.properties + + + maven-surefire-plugin
[camel] branch camel-3.18.x updated: [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 4e6f618932a [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown 4e6f618932a is described below commit 4e6f618932a5fd386454f7b712ed5f2f88baa42f Author: Freeman Fang AuthorDate: Mon Sep 19 13:13:18 2022 -0400 [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown (cherry picked from commit d8318bd5337788a923d340716d4b1eda326f6fd9) --- .../cxf/spring/jaxws/CxfSpringEndpoint.java| 65 ++ 1 file changed, 65 insertions(+) diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java b/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java index 2430a97fc04..ea169aa8422 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java +++ b/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java @@ -25,11 +25,15 @@ import org.apache.camel.component.cxf.common.message.CxfConstants; import org.apache.camel.component.cxf.jaxws.CxfComponent; import org.apache.camel.component.cxf.jaxws.CxfEndpoint; import org.apache.camel.component.cxf.jaxws.WSDLServiceFactoryBean; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.spi.ShutdownStrategy; import org.apache.camel.spring.SpringCamelContext; import org.apache.camel.util.ObjectHelper; import org.apache.cxf.Bus; +import org.apache.cxf.Bus.BusState; import org.apache.cxf.BusFactory; import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor; +import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.bus.spring.SpringBusFactory; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientFactoryBean; @@ -40,6 +44,11 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ApplicationEventMulticaster; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.context.support.AbstractApplicationContext; /** * Defines the http://camel.apache.org/cxf.html";>CXF Endpoint @@ -273,6 +282,7 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext public Bus getBus() { if (bus == null) { bus = createBus(getCamelContext()); +enableSpringBusShutdownGracefully(bus); this.createBus = true; LOG.debug("Using DefaultBus {}", bus); } @@ -295,4 +305,59 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext return busFactory.createBus(); } +@SuppressWarnings("rawtypes") +private void enableSpringBusShutdownGracefully(Bus bus) { +if (bus instanceof SpringBus +&& applicationContext instanceof AbstractApplicationContext) { +SpringBus springBus = (SpringBus) bus; +AbstractApplicationContext abstractApplicationContext += (AbstractApplicationContext) applicationContext; +ApplicationListener cxfSpringBusListener = null; +for (ApplicationListener listener : abstractApplicationContext.getApplicationListeners()) { + +if (listener.getClass().getName().indexOf("org.apache.cxf.bus.spring.SpringBus") >= 0) { +cxfSpringBusListener = listener; +} +} +ApplicationEventMulticaster aem = applicationContext + .getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, +ApplicationEventMulticaster.class); +aem.removeApplicationListener(cxfSpringBusListener); +ApplicationListener listener = new ApplicationListener() { +public void onApplicationEvent(final ApplicationEvent event) { +new Thread() { +public void run() { +if (event instanceof ContextClosedEvent && bus.getState() == BusState.RUNNING) { + +try { +boolean done = false; +ShutdownStrategy shutdownStrategy = ((DefaultCamelContext) getCamelContext()) +.getShutd
[camel] branch main updated: [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown
This is an automated email from the ASF dual-hosted git repository. ffang 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 d8318bd5337 [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown d8318bd5337 is described below commit d8318bd5337788a923d340716d4b1eda326f6fd9 Author: Freeman Fang AuthorDate: Mon Sep 19 13:13:18 2022 -0400 [CAMEL-18528]ensure CXF SpringBus honor camel graceful shutdown --- .../cxf/spring/jaxws/CxfSpringEndpoint.java| 65 ++ 1 file changed, 65 insertions(+) diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java b/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java index 898c97ca191..0f2e2a6566b 100644 --- a/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java +++ b/components/camel-cxf/camel-cxf-spring-soap/src/main/java/org/apache/camel/component/cxf/spring/jaxws/CxfSpringEndpoint.java @@ -25,11 +25,15 @@ import org.apache.camel.component.cxf.common.message.CxfConstants; import org.apache.camel.component.cxf.jaxws.CxfComponent; import org.apache.camel.component.cxf.jaxws.CxfEndpoint; import org.apache.camel.component.cxf.jaxws.WSDLServiceFactoryBean; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.spi.ShutdownStrategy; import org.apache.camel.spring.SpringCamelContext; import org.apache.camel.util.ObjectHelper; import org.apache.cxf.Bus; +import org.apache.cxf.Bus.BusState; import org.apache.cxf.BusFactory; import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor; +import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.bus.spring.SpringBusFactory; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientFactoryBean; @@ -40,6 +44,11 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ApplicationEventMulticaster; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.context.support.AbstractApplicationContext; /** * Defines the http://camel.apache.org/cxf.html";>CXF Endpoint @@ -273,6 +282,7 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext public Bus getBus() { if (bus == null) { bus = createBus(getCamelContext()); +enableSpringBusShutdownGracefully(bus); this.createBus = true; LOG.debug("Using DefaultBus {}", bus); } @@ -294,4 +304,59 @@ public class CxfSpringEndpoint extends CxfEndpoint implements ApplicationContext return busFactory.createBus(); } +@SuppressWarnings("rawtypes") +private void enableSpringBusShutdownGracefully(Bus bus) { +if (bus instanceof SpringBus +&& applicationContext instanceof AbstractApplicationContext) { +SpringBus springBus = (SpringBus) bus; +AbstractApplicationContext abstractApplicationContext += (AbstractApplicationContext) applicationContext; +ApplicationListener cxfSpringBusListener = null; +for (ApplicationListener listener : abstractApplicationContext.getApplicationListeners()) { + +if (listener.getClass().getName().indexOf("org.apache.cxf.bus.spring.SpringBus") >= 0) { +cxfSpringBusListener = listener; +} +} +ApplicationEventMulticaster aem = applicationContext + .getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, +ApplicationEventMulticaster.class); +aem.removeApplicationListener(cxfSpringBusListener); +ApplicationListener listener = new ApplicationListener() { +public void onApplicationEvent(final ApplicationEvent event) { +new Thread() { +public void run() { +if (event instanceof ContextClosedEvent && bus.getState() == BusState.RUNNING) { + +try { +boolean done = false; +ShutdownStrategy shutdownStrategy = ((DefaultCamelContext) getCamelContext()) +.getShutdownStrategy(); +
[camel-spring-boot] branch camel-spring-boot-3.18.x updated: [CAMEL-18509]use servlet transport for camel-cxf spring boot test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-spring-boot-3.18.x in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/camel-spring-boot-3.18.x by this push: new 84feba7e7b7 [CAMEL-18509]use servlet transport for camel-cxf spring boot test 84feba7e7b7 is described below commit 84feba7e7b7a16a8ae22f3d0922827a5f0fcfeeb Author: Freeman Fang AuthorDate: Wed Sep 14 15:45:24 2022 -0400 [CAMEL-18509]use servlet transport for camel-cxf spring boot test (cherry picked from commit b0e105c18437987bdf1403083b32d1d6534711b1) --- components-starter/camel-cxf-rest-starter/pom.xml | 22 ++ .../rest/springboot/CxfRsConsumerWithBeanTest.java | 27 --- .../rest/springboot/CxfRsProducerSessionTest.java | 26 +++ .../cxf/rest/springboot/CxfRsStreamCacheTest.java | 25 +-- .../routes/CxfRsSpringProducerSession.xml | 6 +- components-starter/camel-cxf-soap-starter/pom.xml | 22 ++ .../cxf/soap/springboot/CXFMultiPartTest.java | 16 +++- .../soap/springboot/CxfConsumerMessageTest.java| 20 +++-- .../CxfConsumerPayLoadConverterTest.java | 12 ++- .../soap/springboot/CxfConsumerPayloadTest.java| 86 +++--- .../soap/springboot/CxfConsumerProviderTest.java | 22 -- .../src/test/resources/routes/MultiPartTest.xml| 2 +- 12 files changed, 192 insertions(+), 94 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index b7b936133c0..7c8644dacc2 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -63,6 +63,28 @@ ${cglib-version} test + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + test + + + org.springframework.boot + spring-boot-starter-undertow + test + + + org.apache.cxf + cxf-spring-boot-starter-jaxrs + test + ${cxf-version} + org.apache.camel.springboot diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java index 58b63dc49f8..5fd7a59f3ff 100644 --- a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java @@ -18,7 +18,6 @@ package org.apache.camel.component.cxf.rest.springboot; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cxf.common.CXFTestSupport; import org.apache.camel.component.cxf.jaxrs.testbean.ServiceUtil; import org.apache.camel.spring.boot.CamelAutoConfiguration; @@ -28,10 +27,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; @@ -40,23 +43,24 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; -@DirtiesContext +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) @CamelSpringBootTest @SpringBootTest( classes = { CamelAutoConfiguration.class, CxfRsConsumerWithBeanTest.class, -CxfRsConsumerWithBeanTest.TestConfiguration.class -} +CxfRsConsumerWithBeanTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT ) public class CxfRsConsumerWithBeanTest { -private static final String CXT = CXFTestSupport.getPort1() + "/CxfRsConsumerWithBeanTest"; +private static final String CXT = "/CxfRsConsumerWithBeanTest"; private static final String CXF_RS_ENDPOINT_URI -= "cxfrs://http://localhost:"; + CXT += "cxfrs://" + CXT
[camel-spring-boot] branch main updated: [CAMEL-18509]use servlet transport for camel-cxf spring boot test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new b0e105c1843 [CAMEL-18509]use servlet transport for camel-cxf spring boot test b0e105c1843 is described below commit b0e105c18437987bdf1403083b32d1d6534711b1 Author: Freeman Fang AuthorDate: Wed Sep 14 15:45:24 2022 -0400 [CAMEL-18509]use servlet transport for camel-cxf spring boot test --- components-starter/camel-cxf-rest-starter/pom.xml | 22 ++ .../rest/springboot/CxfRsConsumerWithBeanTest.java | 27 --- .../rest/springboot/CxfRsProducerSessionTest.java | 26 +++ .../cxf/rest/springboot/CxfRsStreamCacheTest.java | 25 +-- .../routes/CxfRsSpringProducerSession.xml | 6 +- components-starter/camel-cxf-soap-starter/pom.xml | 22 ++ .../cxf/soap/springboot/CXFMultiPartTest.java | 16 +++- .../soap/springboot/CxfConsumerMessageTest.java| 20 +++-- .../CxfConsumerPayLoadConverterTest.java | 12 ++- .../soap/springboot/CxfConsumerPayloadTest.java| 86 +++--- .../soap/springboot/CxfConsumerProviderTest.java | 22 -- .../cxf/soap/springboot/WSSUsernameTokenTest.java | 21 -- .../src/test/resources/routes/MultiPartTest.xml| 2 +- .../src/test/resources/routes/soap-security.xml| 2 +- 14 files changed, 207 insertions(+), 102 deletions(-) diff --git a/components-starter/camel-cxf-rest-starter/pom.xml b/components-starter/camel-cxf-rest-starter/pom.xml index 2eb1ae3078d..8ae5c80be67 100644 --- a/components-starter/camel-cxf-rest-starter/pom.xml +++ b/components-starter/camel-cxf-rest-starter/pom.xml @@ -63,6 +63,28 @@ ${cglib-version} test + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + test + + + org.springframework.boot + spring-boot-starter-undertow + test + + + org.apache.cxf + cxf-spring-boot-starter-jaxrs + test + ${cxf-version} + org.apache.camel.springboot diff --git a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java index 58b63dc49f8..5fd7a59f3ff 100644 --- a/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java +++ b/components-starter/camel-cxf-rest-starter/src/test/java/org/apache/camel/component/cxf/rest/springboot/CxfRsConsumerWithBeanTest.java @@ -18,7 +18,6 @@ package org.apache.camel.component.cxf.rest.springboot; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cxf.common.CXFTestSupport; import org.apache.camel.component.cxf.jaxrs.testbean.ServiceUtil; import org.apache.camel.spring.boot.CamelAutoConfiguration; @@ -28,10 +27,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.apache.camel.test.spring.junit5.CamelSpringBootTest; +import org.apache.cxf.spring.boot.autoconfigure.CxfAutoConfiguration; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; @@ -40,23 +43,24 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; -@DirtiesContext +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) @CamelSpringBootTest @SpringBootTest( classes = { CamelAutoConfiguration.class, CxfRsConsumerWithBeanTest.class, -CxfRsConsumerWithBeanTest.TestConfiguration.class -} +CxfRsConsumerWithBeanTest.TestConfiguration.class, +CxfAutoConfiguration.class +}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT ) public class CxfRsConsumerWithBeanTest { -private static final String CXT = CXFTestSupport.getPort1() + "/CxfRsConsumerWithBeanTest"; +private static final String CXT = "/CxfRsConsumerWithBeanTest"; private static final String CXF_RS_ENDPOINT_URI -= "cxfrs://http://localhost:"; + CXT += "cxfrs://" + CXT
[camel] branch camel-3.18.x updated: [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.18.x by this push: new 52ba02b0395 [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime 52ba02b0395 is described below commit 52ba02b03950b1dce7b39e6a5bd5b513b9e710ab Author: Freeman Fang AuthorDate: Mon Aug 15 13:03:38 2022 -0400 [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime (cherry picked from commit 5f73f114c52c219826f8831977e951c0a0cbfcb7) --- .../java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java index 5367424c0c3..231c5266e70 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java @@ -950,15 +950,21 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade public Bus getBus() { if (bus == null) { CamelContext context = getCamelContext(); -if (context.getClass().getName().endsWith("SpringCamelContext")) { +if (context.getClass().getName().endsWith("SpringCamelContext") || + context.getClass().getName().endsWith("SpringBootCamelContext")) { try { Class cxfSpringEndpintUtilClazz = Class.forName("org.apache.camel.component.cxf.spring.jaxws.CxfSpringEndpointUtils"); Method method = cxfSpringEndpintUtilClazz.getMethod("createBus", CamelContext.class); bus = (Bus) method.invoke(null, context); } catch (Exception ex) { -LOG.warn("Error creating Cxf Bus from SpringCamelContext: {} This exception will be ignored.", +if (context.getClass().getName().endsWith("SpringCamelContext")) { +LOG.warn("Error creating Cxf Bus from SpringCamelContext: {} This exception will be ignored.", ex.getMessage(), ex); +} else { +LOG.warn("Error creating Cxf Bus from SpringBootCamelContext: {} This exception will be ignored.", +ex.getMessage(), ex); +} bus = CxfEndpointUtils.createBus(getCamelContext()); } } else {
[camel] branch main updated: [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime
This is an automated email from the ASF dual-hosted git repository. ffang 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 5f73f114c52 [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime new 5162d38f352 Merge branch 'main' of github.com:apache/camel 5f73f114c52 is described below commit 5f73f114c52c219826f8831977e951c0a0cbfcb7 Author: Freeman Fang AuthorDate: Mon Aug 15 13:03:38 2022 -0400 [CAMEL-18394]CXF-Consumer does not start in SpringBoot runtime --- .../java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java index 5367424c0c3..231c5266e70 100644 --- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java +++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfEndpoint.java @@ -950,15 +950,21 @@ public class CxfEndpoint extends DefaultEndpoint implements AsyncEndpoint, Heade public Bus getBus() { if (bus == null) { CamelContext context = getCamelContext(); -if (context.getClass().getName().endsWith("SpringCamelContext")) { +if (context.getClass().getName().endsWith("SpringCamelContext") || + context.getClass().getName().endsWith("SpringBootCamelContext")) { try { Class cxfSpringEndpintUtilClazz = Class.forName("org.apache.camel.component.cxf.spring.jaxws.CxfSpringEndpointUtils"); Method method = cxfSpringEndpintUtilClazz.getMethod("createBus", CamelContext.class); bus = (Bus) method.invoke(null, context); } catch (Exception ex) { -LOG.warn("Error creating Cxf Bus from SpringCamelContext: {} This exception will be ignored.", +if (context.getClass().getName().endsWith("SpringCamelContext")) { +LOG.warn("Error creating Cxf Bus from SpringCamelContext: {} This exception will be ignored.", ex.getMessage(), ex); +} else { +LOG.warn("Error creating Cxf Bus from SpringBootCamelContext: {} This exception will be ignored.", +ex.getMessage(), ex); +} bus = CxfEndpointUtils.createBus(getCamelContext()); } } else {
[camel-spring-boot] branch main updated: [CAMEL-18036]add tests in camel-bean-validator-starter (#552)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 0cb02870576 [CAMEL-18036]add tests in camel-bean-validator-starter (#552) 0cb02870576 is described below commit 0cb02870576ac14ccea26de7d2dc573c4e152d5f Author: Freeman(Yue) Fang AuthorDate: Wed May 4 14:05:36 2022 -0400 [CAMEL-18036]add tests in camel-bean-validator-starter (#552) --- .../springboot/BeanValidatorConfigurationTest.java | 167 + ...anValidatorIgnoreXMLConfigurationRouteTest.java | 61 .../springboot/BeanValidatorRouteTest.java | 392 + .../component/bean/validator/springboot/Car.java | 28 ++ .../validator/springboot/CarWithAnnotations.java | 55 +++ .../springboot/CarWithRedefinedDefaultGroup.java | 57 +++ .../CustomValidationProviderResolverTest.java | 118 +++ .../HibernateValidationProviderResolverTest.java | 113 ++ .../bean/validator/springboot/OptionalChecks.java | 20 ++ .../bean/validator/springboot/OrderedChecks.java | 24 ++ .../bean/validator/springboot/RequiredChecks.java | 20 ++ .../springboot/ValidatorFactoryAutowireTest.java | 97 + .../springboot/ValidatorFactoryRegistryTest.java | 107 ++ .../validator/springboot/ValidatorFactoryTest.java | 68 14 files changed, 1327 insertions(+) diff --git a/components-starter/camel-bean-validator-starter/src/test/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorConfigurationTest.java b/components-starter/camel-bean-validator-starter/src/test/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorConfigurationTest.java new file mode 100644 index 000..8b7b38842b7 --- /dev/null +++ b/components-starter/camel-bean-validator-starter/src/test/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorConfigurationTest.java @@ -0,0 +1,167 @@ +/* + * 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.component.bean.validator.springboot; + + + + + +import java.lang.annotation.ElementType; +import java.util.Locale; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorFactory; +import javax.validation.MessageInterpolator; +import javax.validation.Path; +import javax.validation.TraversableResolver; +import javax.validation.Path.Node; + +import org.apache.camel.CamelContext; +import org.apache.camel.EndpointInject; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.bean.validator.BeanValidatorEndpoint; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spring.boot.CamelAutoConfiguration; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.condition.OS.AIX; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + + +@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +BeanValidatorConfigurationTest.class +} +) +public class BeanValidatorConfigurationTest { + + +@Autowired +ProducerTemplate template; + +@Autowired +CamelContext context; + +@EndpointInject("mock:result") +MockEndpoint mock; + + +private static MessageInterpolator messageInterpolator; + +private static TraversableResolver traversableResolver; + +private static ConstraintValidatorFactory constraintValidatorFactory; + + +
[camel-spring-boot] branch main updated: [CAMEL-17988]add tests in camel-quartz-starter (#537)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 6770272f5b9 [CAMEL-17988]add tests in camel-quartz-starter (#537) 6770272f5b9 is described below commit 6770272f5b941f04f4c50cce3a170d4018b54280 Author: Freeman(Yue) Fang AuthorDate: Fri Apr 22 13:49:09 2022 -0400 [CAMEL-17988]add tests in camel-quartz-starter (#537) --- components-starter/camel-quartz-starter/pom.xml| 12 ++ .../quartz/springboot/BaseQuartzTest.java | 52 +++ .../springboot/DelegateEndpointQuartzTest.java | 167 + .../FileConsumerQuartzSchedulerRestartTest.java| 101 + .../FileConsumerQuartzSchedulerTest.java | 93 .../component/quartz/springboot/FromFileBase.java | 73 + .../springboot/FromFileQuartzSchedulerTest.java| 105 + .../springboot/MultiplePoliciesOnRouteTest.java| 119 +++ .../springboot/QuartUnderscoreTimerNameTest.java | 88 +++ .../springboot/QuartzAddDynamicRouteTest.java | 104 + ...uartzAddRoutesAfterCamelContextStartedTest.java | 81 ++ .../quartz/springboot/QuartzAutoStartTest.java | 104 + .../quartz/springboot/QuartzCronMappingTest.java | 100 .../quartz/springboot/QuartzCronRoute2Test.java| 91 +++ .../springboot/QuartzCronRouteDurableJobTest.java | 70 + .../springboot/QuartzCronRouteFireNowTest.java | 96 .../quartz/springboot/QuartzCronRouteTest.java | 109 ++ .../QuartzCronRouteWithSmallCacheTest.java | 121 +++ .../springboot/QuartzCronTriggerRouteTest.java | 99 .../springboot/QuartzCustomCalendarFireTest.java | 119 +++ .../springboot/QuartzCustomCalendarNoFireTest.java | 115 ++ .../quartz/springboot/QuartzInterruptTest.java | 99 .../springboot/QuartzJobRouteUnderscoreTest.java | 98 .../quartz/springboot/QuartzManagementTest.java| 110 ++ .../springboot/QuartzManuallyTriggerJobTest.java | 111 ++ .../springboot/QuartzRepeatIntervalTest.java | 92 .../springboot/QuartzRouteFireNowOnlyOnceTest.java | 95 .../quartz/springboot/QuartzRouteFireNowTest.java | 96 .../quartz/springboot/QuartzRouteRestartTest.java | 108 + .../quartz/springboot/QuartzRouteTest.java | 95 .../quartz/springboot/QuartzSimpleRouteTest.java | 108 + .../springboot/QuartzStatefulJobRouteTest.java | 105 + .../quartz/springboot/QuartzStopRouteTest.java | 112 ++ .../quartz/springboot/QuartzSuspendRouteTest.java | 113 ++ .../springboot/QuartzTriggerParametersTest.java| 103 + .../RouteAutoStopFalseCronScheduledPolicyTest.java | 84 +++ .../SimpleScheduledCombinedRoutePolicyTest.java| 105 + .../quartz/springboot/StatefulQuartzRouteTest.java | 109 ++ 38 files changed, 3762 insertions(+) diff --git a/components-starter/camel-quartz-starter/pom.xml b/components-starter/camel-quartz-starter/pom.xml index bf97f9ce61f..b49d37b7ae0 100644 --- a/components-starter/camel-quartz-starter/pom.xml +++ b/components-starter/camel-quartz-starter/pom.xml @@ -39,6 +39,18 @@ camel-quartz ${camel-version} + + org.apache.camel + camel-management + ${camel-version} + test + + + org.apache.camel + camel-cron + ${camel-version} + test + org.apache.camel.springboot diff --git a/components-starter/camel-quartz-starter/src/test/java/org/apache/camel/component/quartz/springboot/BaseQuartzTest.java b/components-starter/camel-quartz-starter/src/test/java/org/apache/camel/component/quartz/springboot/BaseQuartzTest.java new file mode 100644 index 000..b55f64abcfe --- /dev/null +++ b/components-starter/camel-quartz-starter/src/test/java/org/apache/camel/component/quartz/springboot/BaseQuartzTest.java @@ -0,0 +1,52 @@ +/* + * 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 CO
[camel] branch main updated: [CAMEL-16958]fix last piece of failed tests on JDK17
This is an automated email from the ASF dual-hosted git repository. ffang 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 31eed8be75a [CAMEL-16958]fix last piece of failed tests on JDK17 new c314d09a78a Merge branch 'main' of github.com:apache/camel 31eed8be75a is described below commit 31eed8be75a94ed71398fd12dff2ed9962936929 Author: Freeman Fang AuthorDate: Tue Apr 19 09:30:55 2022 -0400 [CAMEL-16958]fix last piece of failed tests on JDK17 --- .../camel-infinispan/camel-infinispan/pom.xml | 22 ++ components/camel-servlet/pom.xml | 19 +++ 2 files changed, 41 insertions(+) diff --git a/components/camel-infinispan/camel-infinispan/pom.xml b/components/camel-infinispan/camel-infinispan/pom.xml index eea6dcfbe6a..f66cc9a5f06 100644 --- a/components/camel-infinispan/camel-infinispan/pom.xml +++ b/components/camel-infinispan/camel-infinispan/pom.xml @@ -159,4 +159,26 @@ + + + +jdk17-build + +[17,) + + + + +maven-failsafe-plugin + + + tcp + +--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED + + + + + + diff --git a/components/camel-servlet/pom.xml b/components/camel-servlet/pom.xml index 61beb176f13..b0a34d5 100644 --- a/components/camel-servlet/pom.xml +++ b/components/camel-servlet/pom.xml @@ -120,4 +120,23 @@ test + + +jdk17-build + +[17,) + + + + +maven-surefire-plugin + +--add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED + + + + + + +
[camel-spring-boot] branch main updated: [CAMEL-17804]add tests in camel-jacksonxml-starter (#470)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new f16b7e3 [CAMEL-17804]add tests in camel-jacksonxml-starter (#470) f16b7e3 is described below commit f16b7e34202476ec46c4143f6c8963232f75b7be Author: Freeman(Yue) Fang AuthorDate: Wed Mar 16 12:15:17 2022 -0400 [CAMEL-17804]add tests in camel-jacksonxml-starter (#470) (cherry picked from commit 81e868a80a3415b5b30ee3a80d05891a3ff4ea24) --- .../springboot/JacksonConcurrentTest.java | 125 +++ .../springboot/JacksonConversionsSimpleTest.java | 103 .../springboot/JacksonConversionsTest.java | 112 + .../springboot/JacksonIncludeDefaultTest.java | 98 .../springboot/JacksonIncludeNotNulllTest.java | 103 .../springboot/JacksonJAXBAnnotationTest.java | 117 ++ .../springboot/JacksonJsonDataFormatTest.java | 76 + .../springboot/JacksonMarshalAllowJMSTypeTest.java | 106 + .../JacksonMarshalContentTypeHeaderTest.java | 133 .../springboot/JacksonMarshalDateTimezoneTest.java | 110 + .../jacksonxml/springboot/JacksonMarshalTest.java | 167 +++ .../JacksonMarshalUnmarshalListTest.java | 136 ...onMarshalUnmarshalTypeHeaderNotAllowedTest.java | 100 .../JacksonMarshalUnmarshalTypeHeaderTest.java | 110 + .../springboot/JacksonMarshalViewTest.java | 131 +++ .../springboot/JacksonModuleRefTest.java | 80 ++ .../jacksonxml/springboot/JacksonModuleTest.java | 107 + .../springboot/JacksonObjectListSplitTest.java | 111 + .../springboot/ListJacksonUnmarshalDTest.java | 71 + .../component/jacksonxml/springboot/MyModule.java | 45 ++ .../springboot/SpringJacksonEnableFeatureTest.java | 82 ++ .../SpringJacksonMarshalUnmarshalListTest.java | 113 + .../springboot/SpringJacksonXmlDataFormatTest.java | 176 + .../jacksonxml/springboot/TestJAXBPojo.java| 50 ++ .../jacksonxml/springboot/TestOtherPojo.java | 40 + .../component/jacksonxml/springboot/TestPojo.java | 45 ++ .../jacksonxml/springboot/TestPojoView.java| 85 ++ .../component/jacksonxml/springboot/Views.java | 28 .../routes/SpringJacksonEnableFeatureTest.xml | 29 .../SpringJacksonMarshalUnmarshalListTest.xml | 27 .../routes/SpringJacksonXmlDataFormatTest.xml | 61 +++ 31 files changed, 2877 insertions(+) diff --git a/components-starter/camel-jacksonxml-starter/src/test/java/org/apache/camel/component/jacksonxml/springboot/JacksonConcurrentTest.java b/components-starter/camel-jacksonxml-starter/src/test/java/org/apache/camel/component/jacksonxml/springboot/JacksonConcurrentTest.java new file mode 100644 index 000..000d6a9 --- /dev/null +++ b/components-starter/camel-jacksonxml-starter/src/test/java/org/apache/camel/component/jacksonxml/springboot/JacksonConcurrentTest.java @@ -0,0 +1,125 @@ +/* + * 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.component.jacksonxml.springboot; + + +import static org.apache.camel.test.junit5.TestSupport.body; + +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + + +import org.apache.camel.CamelContext; +import org.apache.camel.EndpointInject; +import org.apache.camel.Produce; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + +import org.junit.jupiter.api.Test; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.Spr
[camel-spring-boot] branch main updated: [CAMEL-17794]add tests in camel-saxon-starter (#468)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 8e926a2 [CAMEL-17794]add tests in camel-saxon-starter (#468) 8e926a2 is described below commit 8e926a2cf299a2ce68be7904089e324366553167 Author: Freeman(Yue) Fang AuthorDate: Tue Mar 15 15:24:56 2022 -0400 [CAMEL-17794]add tests in camel-saxon-starter (#468) --- .../springboot/BeanWithXQueryInjectionTest.java| 110 ++ .../language/xquery/springboot/FromFileBase.java | 73 +++ .../SaxonLanguageExtensionFunctionsTest.java | 98 + .../xquery/springboot/SaxonXPathSplitTest.java | 110 ++ .../language/xquery/springboot/SaxonXPathTest.java | 104 ++ .../xquery/springboot/SoapPayloadBean.java | 35 .../xquery/springboot/SoapPayloadBeanTest.java | 83 .../XPathHeaderEnableSaxonJavaDslTest.java | 119 +++ .../XPathSplitChoicePerformanceTest.java | 229 + .../xquery/springboot/XQueryConcurrencyTest.java | 120 +++ .../xquery/springboot/XQueryFilterTest.java| 95 + .../springboot/XQueryFromFileExceptionTest.java| 130 .../xquery/springboot/XQueryFromFileTest.java | 103 + ...XQueryHeaderNameResultTypeAndNamespaceTest.java | 93 + .../xquery/springboot/XQueryHeaderNameTest.java| 126 .../springboot/XQueryLanguageFromFileTest.java | 110 ++ .../springboot/XQueryPredicateFilterTest.java | 99 + .../springboot/XQueryPropogateHeadersTest.java | 125 +++ .../xquery/springboot/XQueryRecipientListTest.java | 106 ++ .../xquery/springboot/XQueryResourceTest.java | 84 .../springboot/XQueryTransformIssueTest.java | 93 + .../xquery/springboot/XQueryTransformTest.java | 86 .../xquery/springboot/XQueryTransformTextTest.java | 84 .../springboot/XQueryURLBasedConcurrencyTest.java | 131 .../xquery/springboot/XQueryWithExtensionTest.java | 151 ++ .../xquery/springboot/XQueryWithFlworTest.java | 79 +++ .../springboot/XQueryWithNamespacesFilterTest.java | 98 + .../src/test/resources/log4j2.properties | 28 +++ .../src/test/resources/myinput.xml | 27 +++ .../src/test/resources/myxquery.txt| 1 + .../xquery/XQueryComponentConfigurationTest.xml| 49 + .../xquery/XQueryEndpointConfigurationTest.xml | 46 + .../apache/camel/component/xquery/camelContext.xml | 41 .../camel/component/xquery/flwor-expression.xquery | 9 + .../camel/component/xquery/myTransform.xquery | 4 + .../apache/camel/component/xquery/transform.xquery | 3 + .../component/xquery/transformWithExtension.xquery | 6 + .../component/xquery/transform_with_headers.xquery | 4 + .../camel/component/xquery/xqueryExampleTest.xml | 37 .../xquery/xqueryWithExplicitTypeContext.xml | 38 .../src/test/resources/payload.xml | 39 41 files changed, 3206 insertions(+) diff --git a/components-starter/camel-saxon-starter/src/test/java/org/apache/camel/language/xquery/springboot/BeanWithXQueryInjectionTest.java b/components-starter/camel-saxon-starter/src/test/java/org/apache/camel/language/xquery/springboot/BeanWithXQueryInjectionTest.java new file mode 100644 index 000..d06c942 --- /dev/null +++ b/components-starter/camel-saxon-starter/src/test/java/org/apache/camel/language/xquery/springboot/BeanWithXQueryInjectionTest.java @@ -0,0 +1,110 @@ +/* + * 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.language.xquery.springboot; + + + +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.xquery.XQuery; +import org.apache.camel.spring.boot.CamelAutoConfiguration; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.Spr
[camel-spring-boot] branch main updated: [CAMEL-17777]add tests in camel-webhook-starter (#463)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new c9edbbb [CAMEL-1]add tests in camel-webhook-starter (#463) c9edbbb is described below commit c9edbbbe2bc2150ff632ab9a4d6afe7a3227c0a8 Author: Freeman(Yue) Fang AuthorDate: Fri Mar 11 17:56:44 2022 -0500 [CAMEL-1]add tests in camel-webhook-starter (#463) (cherry picked from commit e79c618cbb3e109308c4f3f990a951d942f95fb6) --- components-starter/camel-webhook-starter/pom.xml | 26 .../webhook/springboot/TestComponent.java | 49 +++ .../component/webhook/springboot/TestEndpoint.java | 163 + .../webhook/springboot/WebhookBasePathTest.java| 163 + .../webhook/springboot/WebhookHttpBindingTest.java | 128 .../webhook/springboot/WebhookMultiRouteTest.java | 121 +++ .../webhook/springboot/WebhookPathTest.java| 141 ++ .../webhook/springboot/WebhookUriEncodingTest.java | 117 +++ 8 files changed, 908 insertions(+) diff --git a/components-starter/camel-webhook-starter/pom.xml b/components-starter/camel-webhook-starter/pom.xml index 06d2f01..624e42b 100644 --- a/components-starter/camel-webhook-starter/pom.xml +++ b/components-starter/camel-webhook-starter/pom.xml @@ -39,6 +39,32 @@ camel-webhook ${camel-version} + + + org.apache.camel + camel-test-junit5 + test + + + org.awaitility + awaitility + test + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + org.apache.camel + camel-netty-http + test + + + org.assertj + assertj-core + test + org.apache.camel.springboot diff --git a/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestComponent.java b/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestComponent.java new file mode 100644 index 000..93a9c4f --- /dev/null +++ b/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestComponent.java @@ -0,0 +1,49 @@ +/* + * 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.component.webhook.springboot; + +import java.util.Map; +import java.util.function.Consumer; + +import org.apache.camel.support.DefaultComponent; + +public class TestComponent extends DefaultComponent { + +private TestEndpoint endpoint; + +private Consumer customizer; + +public TestComponent() { +} + +public TestComponent(Consumer customizer) { +this.customizer = customizer; +} + +@Override +protected TestEndpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { +if (this.endpoint == null) { +this.endpoint = new TestEndpoint(uri, this); +if (this.customizer != null) { +this.customizer.accept(this.endpoint); +} +} + +return this.endpoint; +} + +} diff --git a/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestEndpoint.java b/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestEndpoint.java new file mode 100644 index 000..1c50da5 --- /dev/null +++ b/components-starter/camel-webhook-starter/src/test/java/org/apache/camel/component/webhook/springboot/TestEndpoint.java @@ -0,0 +1,163 @@ +/* + * 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 + *
[camel-spring-boot] branch main updated: [CAMEL-17766]add tests in camel-slack-starter (#461)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 74589a5 [CAMEL-17766]add tests in camel-slack-starter (#461) 74589a5 is described below commit 74589a5685d03cccba39bc8449388373723f578b Author: Freeman(Yue) Fang AuthorDate: Thu Mar 10 14:50:32 2022 -0500 [CAMEL-17766]add tests in camel-slack-starter (#461) (cherry picked from commit a680db972ef603429da5edb6e26c008eb26e1733) --- components-starter/camel-slack-starter/pom.xml | 6 + .../SlackComponentVerifierExtensionTest.java | 149 + .../slack/springboot/SlackProducerTest.java| 137 +++ 3 files changed, 292 insertions(+) diff --git a/components-starter/camel-slack-starter/pom.xml b/components-starter/camel-slack-starter/pom.xml index edb2550..bc4f320 100644 --- a/components-starter/camel-slack-starter/pom.xml +++ b/components-starter/camel-slack-starter/pom.xml @@ -39,6 +39,12 @@ camel-slack ${camel-version} + + org.apache.camel.springboot + camel-undertow-starter + ${camel-version} + test + org.apache.camel.springboot diff --git a/components-starter/camel-slack-starter/src/test/java/org/apache/camel/component/slack/springboot/SlackComponentVerifierExtensionTest.java b/components-starter/camel-slack-starter/src/test/java/org/apache/camel/component/slack/springboot/SlackComponentVerifierExtensionTest.java new file mode 100644 index 000..828504c --- /dev/null +++ b/components-starter/camel-slack-starter/src/test/java/org/apache/camel/component/slack/springboot/SlackComponentVerifierExtensionTest.java @@ -0,0 +1,149 @@ +/* + * 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.component.slack.springboot; + + +import java.util.HashMap; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.Component; +import org.apache.camel.EndpointInject; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.extension.ComponentVerifierExtension; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + + +@DirtiesContext +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +SlackComponentVerifierExtensionTest.class +} +) +public class SlackComponentVerifierExtensionTest { + +@Autowired +private CamelContext context; + +@Autowired +ProducerTemplate template; + +@EndpointInject("mock:authors") +MockEndpoint mock; + + + + +@Test +public void testParametersWebhook() throws Exception { +Component component = context.getComponent("slack"); + +ComponentVerifierExtension verifier += component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); + +Map parameters = new HashMap<>(); +parameters.put("webhookUrl", "l"); + +ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters); + +assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus()); +} + +@Test +public void testParametersToken() throws Exception { +Component component = context.getComponent("slack"); + +ComponentVerifierExtension verifier += component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); + +Map parameters = new HashMap<>(); +parameters.put(&qu
[camel-spring-boot] branch main updated: [CAMEL-17758]add tests in camel-cassandraql-starter (#458)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new f43a4b4 [CAMEL-17758]add tests in camel-cassandraql-starter (#458) f43a4b4 is described below commit f43a4b40a226ba3a2a28b8716230669c5e5e150a Author: Freeman(Yue) Fang AuthorDate: Tue Mar 8 17:38:51 2022 -0500 [CAMEL-17758]add tests in camel-cassandraql-starter (#458) (cherry picked from commit c7335a6467079c6bc1901037681d351597834752) --- .../camel-cassandraql-starter/pom.xml | 70 ++ .../cassandra/MockLoadBalancingPolicy.java | 43 .../integration/CassandraComponentBeanRefIT.java | 92 .../integration/CassandraComponentConsumerIT.java | 134 .../integration/CassandraComponentProducerIT.java | 234 + .../CassandraComponentProducerUnpreparedIT.java| 156 ++ .../cassandra/springboot/BaseCassandra.java| 113 ++ .../cassandra/CassandraAggregationIT.java | 123 +++ .../CassandraAggregationRepositoryIT.java | 222 +++ .../CassandraAggregationSerializedHeadersIT.java | 128 +++ .../NamedCassandraAggregationRepositoryIT.java | 227 .../camel/processor/aggregate/util/HeaderDto.java | 62 ++ .../cassandra/CassandraIdempotentIT.java | 96 + .../cassandra/CassandraIdempotentRepositoryIT.java | 153 ++ .../NamedCassandraIdempotentRepositoryIT.java | 155 ++ .../src/test/resources/BasicDataSet.cql| 6 + .../src/test/resources/IdempotentDataSet.cql | 8 + .../src/test/resources/NamedIdempotentDataSet.cql | 8 + .../src/test/resources/initScript.cql | 33 +++ 19 files changed, 2063 insertions(+) diff --git a/components-starter/camel-cassandraql-starter/pom.xml b/components-starter/camel-cassandraql-starter/pom.xml index 347a961..36a0f63 100644 --- a/components-starter/camel-cassandraql-starter/pom.xml +++ b/components-starter/camel-cassandraql-starter/pom.xml @@ -39,6 +39,14 @@ camel-cassandraql ${camel-version} + + + org.apache.camel + camel-test-infra-cassandra + ${camel-version} + test-jar + test + com.datastax.oss @@ -56,4 +64,66 @@ + + + + cassandraql-integration-tests-docker-file + + + /var/run/docker.sock + + + + + +org.apache.maven.plugins +maven-failsafe-plugin + + +true + + + + + + integration-test + verify + + + + + + + + + + cassandraql-integration-tests-docker-env + + + env.DOCKER_HOST + + + + + +org.apache.maven.plugins +maven-failsafe-plugin + + +true + + + + + + integration-test + verify + + + + + + + + diff --git a/components-starter/camel-cassandraql-starter/src/test/java/org/apache/camel/component/cassandra/MockLoadBalancingPolicy.java b/components-starter/camel-cassandraql-starter/src/test/java/org/apache/camel/component/cassandra/MockLoadBalancingPolicy.java new file mode 100644 index 000..8a68c07 --- /dev/null +++ b/components-starter/camel-cassandraql-starter/src/test/java/org/apache/camel/component/cassandra/MockLoadBalancingPolicy.java @@ -0,0 +1,43 @@ +/* + * 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.component.cassandra; + +import java.util.Queue; + +import com.datastax.oss.driver.api.core.context.Dr
[camel-spring-boot] branch main updated: [CAMEL-17747]add tests in camel-cron-starter (#456)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new f0fec59 [CAMEL-17747]add tests in camel-cron-starter (#456) f0fec59 is described below commit f0fec5906cd014a76355302f27568dc9cc4c6140 Author: Freeman(Yue) Fang AuthorDate: Tue Mar 8 16:43:05 2022 -0500 [CAMEL-17747]add tests in camel-cron-starter (#456) --- .../component/cron/springboot/CronLoaderTest.java | 110 + .../cron/springboot/DummyCamelCronService.java | 61 2 files changed, 171 insertions(+) diff --git a/components-starter/camel-cron-starter/src/test/java/org/apache/camel/component/cron/springboot/CronLoaderTest.java b/components-starter/camel-cron-starter/src/test/java/org/apache/camel/component/cron/springboot/CronLoaderTest.java new file mode 100644 index 000..a7a4426 --- /dev/null +++ b/components-starter/camel-cron-starter/src/test/java/org/apache/camel/component/cron/springboot/CronLoaderTest.java @@ -0,0 +1,110 @@ +/* + * 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.component.cron.springboot; + + +import org.apache.camel.CamelContext; +import org.apache.camel.EndpointInject; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cron.CronComponent; +import org.apache.camel.component.cron.api.CamelCronService; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.CamelContextConfiguration; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + + +@DirtiesContext +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +CronLoaderTest.class, +CronLoaderTest.TestConfiguration.class +} +) +public class CronLoaderTest { + +@Autowired +private CamelContext context; + +@Autowired +ProducerTemplate template; + +@EndpointInject("mock:result") +MockEndpoint mock; + +@Bean("dummy2") +private DummyCamelCronService getDummyCamelCronService() { +return new DummyCamelCronService("dummy2"); +} + + + + + +@Test +void testDummyCronServiceLoading() throws Exception { + +mock.expectedMinimumMessageCount(1); + +mock.assertIsSatisfied(); +} + +@Test +void testPreferRegistryOverServiceLoading() throws Exception { +assertEquals("dummy2", getCamelCronService().getId()); +} + + + +private CamelCronService getCamelCronService() { +return context.getComponent("cron", CronComponent.class).getService(); +} + + +// * +// Config +// * + +@Configuration +public static class TestConfiguration { + +@Bean +public RouteBuilder routeBuilder() { +return new RouteBuilder() { +@Override +public void configure() { +from("cron:tab?schedule=0/1 * * * * ?") +.setBody().constant("x") +.to("mock:result"); +} +}; +} +} +} diff --git a/components-starter/camel-cron-starter/src/test/java/org/apache/camel/component/cron/springboot/DummyCamelCronService.java b/components-starter/camel-cron-starter/src/test/java/org/apache/camel/component/cron/springboot/DummyCamelCronService.java new file mo
[camel-spring-boot] branch main updated: [CAMEL-17746]add tests in camel-gson-starter (#455)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new a980349 [CAMEL-17746]add tests in camel-gson-starter (#455) a980349 is described below commit a98034901d6d60df838fbcf7553a145e2827d695 Author: Freeman(Yue) Fang AuthorDate: Fri Mar 4 21:20:07 2022 -0500 [CAMEL-17746]add tests in camel-gson-starter (#455) --- .../component/gson/springboot/ExcludeAge.java | 27 .../component/gson/springboot/ExcludeWeight.java | 27 .../gson/springboot/GsonConcurrentTest.java| 114 ++ .../gson/springboot/GsonFieldNamePolicyTest.java | 102 + .../gson/springboot/GsonJsonDataFormatTest.java| 91 +++ .../gson/springboot/GsonMarshalExclusionTest.java | 167 + .../gson/springboot/GsonMarshalListTest.java | 114 ++ .../component/gson/springboot/GsonMarshalTest.java | 128 .../GsonUnmarshalTypeFromHeaderTest.java | 83 ++ .../component/gson/springboot/PersonPojo.java | 48 ++ .../springboot/SpringGsonFieldNamePolicyTest.java | 89 +++ .../springboot/SpringGsonJsonDataFormatTest.java | 116 ++ .../SpringGsonUnmarshalTypeFromHeaderTest.java | 60 .../camel/component/gson/springboot/TestPojo.java | 45 ++ .../gson/springboot/TestPojoExclusion.java | 82 ++ .../routes/SpringGsonFieldNamePolicyTest.xml | 35 + .../routes/SpringGsonJsonDataFormatTest.xml| 51 +++ .../SpringGsonUnmarshalTypeFromHeaderTest.xml | 32 18 files changed, 1411 insertions(+) diff --git a/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeAge.java b/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeAge.java new file mode 100644 index 000..705dc24 --- /dev/null +++ b/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeAge.java @@ -0,0 +1,27 @@ +/* + * 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.component.gson.springboot; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.FIELD }) +public @interface ExcludeAge { +} diff --git a/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeWeight.java b/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeWeight.java new file mode 100644 index 000..c5cad43 --- /dev/null +++ b/components-starter/camel-gson-starter/src/test/java/org/apache/camel/component/gson/springboot/ExcludeWeight.java @@ -0,0 +1,27 @@ +/* + * 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.component.gson.springboot; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.FIELD }) +public @interface Exc
[camel-spring-boot] branch main updated: add tests in camel-platform-http-start (#452)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new cd9e6d0 add tests in camel-platform-http-start (#452) cd9e6d0 is described below commit cd9e6d075c96706519936f64b71182f734d7313c Author: Freeman(Yue) Fang AuthorDate: Thu Mar 3 14:51:31 2022 -0500 add tests in camel-platform-http-start (#452) --- .../camel-platform-http-starter/pom.xml| 18 +++ .../JettyCustomPlatformHttpConsumer.java | 130 +++ .../springboot/JettyCustomPlatformHttpEngine.java | 31 + .../platform/http/springboot/JettyServerTest.java | 53 .../platform/http/springboot/PlatformHttpTest.java | 144 + ...stPlatformHttpContextPathConfigurationTest.java | 130 +++ 6 files changed, 506 insertions(+) diff --git a/components-starter/camel-platform-http-starter/pom.xml b/components-starter/camel-platform-http-starter/pom.xml index 7d40ea1..89a421a 100644 --- a/components-starter/camel-platform-http-starter/pom.xml +++ b/components-starter/camel-platform-http-starter/pom.xml @@ -39,6 +39,24 @@ camel-platform-http ${camel-version} + + io.rest-assured + rest-assured + ${rest-assured-version} + test + + + org.eclipse.jetty + jetty-server + ${jetty9-version} + + + org.eclipse.jetty.orbit + javax.servlet + + + test + org.apache.camel.springboot diff --git a/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/JettyCustomPlatformHttpConsumer.java b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/JettyCustomPlatformHttpConsumer.java new file mode 100644 index 000..a7cdb13 --- /dev/null +++ b/components-starter/camel-platform-http-starter/src/test/java/org/apache/camel/component/platform/http/springboot/JettyCustomPlatformHttpConsumer.java @@ -0,0 +1,130 @@ +/* + * 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.component.platform.http.springboot; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.regex.Pattern; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.apache.camel.component.platform.http.PlatformHttpEndpoint; +import org.apache.camel.support.CamelContextHelper; +import org.apache.camel.support.DefaultConsumer; +import org.apache.camel.support.DefaultMessage; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.eclipse.jetty.server.handler.ContextHandler; + +public class JettyCustomPlatformHttpConsumer extends DefaultConsumer { +private static final Pattern PATH_PARAMETER_PATTERN = Pattern.compile("\\{([^/}]+)\\}"); + +public JettyCustomPlatformHttpConsumer(PlatformHttpEndpoint endpoint, Processor processor) { +super(endpoint, processor); +} + +@Override +protected void doStart() throws Exception { +super.doStart(); +final PlatformHttpEndpoint endpoint = getEndpoint(); +final String path = configureEndpointPath(endpoint); + +JettyServerTest jettyServerTest = CamelContextHelper.mandatoryLookup( +getEndpoint().getCamelContext(), +JettyServerTest.JETTY_SERVER_NAME, +JettyServerTest.class); + +ContextHandler contextHandler = createHandler(endpoint, path); +// add handler after starting server. +jettyServerTest.addHandler(contextHandler); + +} + +private ContextHandler createHandler(PlatformHttpEndpoint endpoint, String path) { +ContextHandler contextHandler = new ContextHandler(); +contextHandler.setContextPath(path); +
[camel-spring-boot] branch main updated (438ebed -> 91795dd)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git. from 438ebed [create-pull-request] automated change add 91795dd [CAMEL-17736]add tests in camel-jackson-protobuf-starter (#451) No new revisions were added by this update. Summary of changes: .../JacksonProtobufLookupResolverTest.java}| 44 +++- ...cksonProtobufMarshalUnmarshalJsonNodeTest.java} | 48 +++--- .../JacksonProtobufMarshalUnmarshalPojoTest.java} | 37 - 3 files changed, 65 insertions(+), 64 deletions(-) copy components-starter/{camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroLookupResolverTest.java => camel-jackson-protobuf-starter/src/test/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufLookupResolverTest.java} (76%) copy components-starter/{camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroMarshalUnmarshalPojoTest.java => camel-jackson-protobuf-starter/src/test/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufMarshalUnmarshalJsonNodeTest.java} (70%) copy components-starter/{camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroMarshalUnmarshalPojoTest.java => camel-jackson-protobuf-starter/src/test/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufMarshalUnmarshalPojoTest.java} (77%)
[camel-spring-boot] branch main updated: [CAMEL-17735]add tests in camel-jackson-avro-starter (#449)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new c605b02 [CAMEL-17735]add tests in camel-jackson-avro-starter (#449) c605b02 is described below commit c605b02305409802505f94a5125acefd67e1317d Author: Freeman(Yue) Fang AuthorDate: Wed Mar 2 17:16:52 2022 -0500 [CAMEL-17735]add tests in camel-jackson-avro-starter (#449) --- .../test/JacksonAvroLookupResolverTest.java| 145 .../JacksonAvroMarshalUnmarshalJsonNodeTest.java | 189 + .../JacksonAvroMarshalUnmarshalPojoListTest.java | 159 + .../test/JacksonAvroMarshalUnmarshalPojoTest.java | 149 4 files changed, 642 insertions(+) diff --git a/components-starter/camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroLookupResolverTest.java b/components-starter/camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroLookupResolverTest.java new file mode 100644 index 000..21a0daa --- /dev/null +++ b/components-starter/camel-jackson-avro-starter/src/test/java/org/apache/camel/component/jackson/avro/springboot/test/JacksonAvroLookupResolverTest.java @@ -0,0 +1,145 @@ +/* + * 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.component.jackson.avro.springboot.test; + + +import com.fasterxml.jackson.dataformat.avro.AvroSchema; + +import org.apache.avro.Schema; +import org.apache.camel.EndpointInject; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.jackson.SchemaResolver; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.model.dataformat.AvroLibrary; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + + +@DirtiesContext +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +JacksonAvroLookupResolverTest.class, +JacksonAvroLookupResolverTest.TestConfiguration.class +} +) +public class JacksonAvroLookupResolverTest { + + +@Autowired +ProducerTemplate template; + +@EndpointInject("mock:serialized") +MockEndpoint mock1; + +@EndpointInject("mock:pojo") +MockEndpoint mock2; + +@Bean("schema-resolver-1") +private SchemaResolver getSchemaResolver() { +String schemaJson = "{\n" ++ "\"type\": \"record\",\n" ++ "\"name\": \"Pojo\",\n" ++ "\"fields\": [\n" ++ " {\"name\": \"text\", \"type\": \"string\"}\n" ++ "]}"; +Schema raw = new Schema.Parser().setValidate(true).parse(schemaJson); +AvroSchema schema = new AvroSchema(raw); +SchemaResolver resolver = ex -> schema; + +return resolver; +} + +@Test +public void testMarshalUnmarshalPojo() throws Exception { + +mock1.expectedMessageCount(1); +mock1.message(0).body().isInstanceOf(byte[].class); + +Pojo pojo = new Pojo("Hello"); +template.sendBody("direct:pojo", pojo); + +mock1.assertIsSatisfied(); + +byte[] serialized = mock1.getReceivedExchanges().get(0).getIn().getBody(byte[].class); +assertNotNull(serialized);
[camel-spring-boot] branch main updated: [CAMEL-17661]add tests in camel-avro-starter (#436)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new dd09aff [CAMEL-17661]add tests in camel-avro-starter (#436) dd09aff is described below commit dd09aff29c487aeecab79adb47c21e3f6cfd758e Author: Freeman(Yue) Fang AuthorDate: Thu Feb 17 07:34:54 2022 -0500 [CAMEL-17661]add tests in camel-avro-starter (#436) --- components-starter/camel-avro-starter/pom.xml | 23 .../test/AvroGenericMarshaAndUnmarshaTest.java | 122 ++ .../test/AvroMarshalAndUnmarshallTest.java | 138 .../test/AvroMarshalAndUnmarshallXmlTest.java | 116 + .../dataformat/avro/springboot/test/Value.java | 139 + .../dataformat/avro/springboot/test/user.avsc | 7 ++ .../src/test/resources/routes/springDataFormat.xml | 50 7 files changed, 595 insertions(+) diff --git a/components-starter/camel-avro-starter/pom.xml b/components-starter/camel-avro-starter/pom.xml index 5108e02..928341a 100644 --- a/components-starter/camel-avro-starter/pom.xml +++ b/components-starter/camel-avro-starter/pom.xml @@ -39,6 +39,29 @@ camel-avro ${camel-version} + + + org.apache.camel + camel-test-spring-junit5 + + + org.apache.camel + camel-spring-xml + + + test + + + org.awaitility + awaitility + test + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot-version} + test + org.apache.camel.springboot diff --git a/components-starter/camel-avro-starter/src/test/java/org/apache/camel/dataformat/avro/springboot/test/AvroGenericMarshaAndUnmarshaTest.java b/components-starter/camel-avro-starter/src/test/java/org/apache/camel/dataformat/avro/springboot/test/AvroGenericMarshaAndUnmarshaTest.java new file mode 100644 index 000..0c2eb70 --- /dev/null +++ b/components-starter/camel-avro-starter/src/test/java/org/apache/camel/dataformat/avro/springboot/test/AvroGenericMarshaAndUnmarshaTest.java @@ -0,0 +1,122 @@ +/* + * 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.dataformat.avro.springboot.test; + + +import java.io.File; +import java.io.IOException; + +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericData; +import org.apache.avro.generic.GenericRecord; +import org.apache.camel.EndpointInject; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.dataformat.avro.AvroDataFormat; +import org.apache.camel.spring.boot.CamelAutoConfiguration; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.annotation.DirtiesContext; +import org.apache.camel.test.spring.junit5.CamelSpringBootTest; + + +@DirtiesContext +@CamelSpringBootTest +@SpringBootTest( +classes = { +CamelAutoConfiguration.class, +AvroGenericMarshaAndUnmarshaTest.class, +AvroGenericMarshaAndUnmarshaTest.TestConfiguration.class +} + +) +public class AvroGenericMarshaAndUnmarshaTest { + +private static Schema schema; + + +@Autowired +ProducerTemplate template; + +@EndpointInject("mock:reverse") +MockEndpoint mock; + + + + +@Test +public void testGenericMarshalAndUnmarshal() throws InterruptedException { +marshalAndUnmarshalGeneric("direct:in", "direct:back"); +} + +private void marshalAndUnmarshalGeneric(String inURI, String outURI) throws InterruptedException { +
[camel] 01/01: [CAMEL-17618]follow up fix and re-enable failure test
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch CAMEL-17618-2 in repository https://gitbox.apache.org/repos/asf/camel.git commit 121ae617019f5dc53eea57479d05f84d1eafc7fc Author: Freeman Fang AuthorDate: Fri Feb 11 11:24:51 2022 -0500 [CAMEL-17618]follow up fix and re-enable failure test --- .../org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java | 2 -- .../src/main/java/org/apache/camel/component/ref/RefEndpoint.java | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java index e2a85af..27e3749 100644 --- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java +++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/AbstractCXFGreeterRouterTest.java @@ -26,7 +26,6 @@ import org.apache.camel.util.IOHelper; import org.apache.hello_world_soap_http.Greeter; import org.apache.hello_world_soap_http.NoSuchCodeLitFault; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -66,7 +65,6 @@ public abstract class AbstractCXFGreeterRouterTest extends CamelSpringTestSuppor } @Test -@Disabled public void testInvokingServiceFromCXFClient() throws Exception { Service service = Service.create(serviceName); service.addPort(routerPortName, "http://schemas.xmlsoap.org/soap/";, diff --git a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java index caef53d8..07f8859 100644 --- a/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java +++ b/components/camel-ref/src/main/java/org/apache/camel/component/ref/RefEndpoint.java @@ -77,7 +77,8 @@ public class RefEndpoint extends DefaultEndpoint implements DelegateEndpoint { if (endpoint == null) { // endpoint is mandatory endpoint = CamelContextHelper.mandatoryLookup(getCamelContext(), name, Endpoint.class); -if (getCamelContext().getEndpoint(getEndpoint().getEndpointUri()) == null) { +if (getCamelContext().getEndpoint(getEndpoint().getEndpointUri()) == null +|| getCamelContext().getEndpoint(getEndpoint().getEndpointUri()) != endpoint) { getCamelContext().addEndpoint(getEndpoint().getEndpointUri(), endpoint); } }
[camel] branch CAMEL-17618-2 created (now 121ae61)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a change to branch CAMEL-17618-2 in repository https://gitbox.apache.org/repos/asf/camel.git. at 121ae61 [CAMEL-17618]follow up fix and re-enable failure test This branch includes the following new commits: new 121ae61 [CAMEL-17618]follow up fix and re-enable failure test The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[camel] branch main updated: [CAMEL-17362]camel-openapi-jave and camel-swagger-java should have camel-rest dependency
This is an automated email from the ASF dual-hosted git repository. ffang 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 93d1e06 [CAMEL-17362]camel-openapi-jave and camel-swagger-java should have camel-rest dependency 93d1e06 is described below commit 93d1e063cae7444a47668bdbe60d5172c1bb189a Author: Freeman Fang AuthorDate: Thu Feb 10 12:35:53 2022 -0500 [CAMEL-17362]camel-openapi-jave and camel-swagger-java should have camel-rest dependency --- components/camel-rest-openapi/pom.xml | 5 + components/camel-rest-swagger/pom.xml | 5 + 2 files changed, 10 insertions(+) diff --git a/components/camel-rest-openapi/pom.xml b/components/camel-rest-openapi/pom.xml index cf7a672..9da7c1c 100644 --- a/components/camel-rest-openapi/pom.xml +++ b/components/camel-rest-openapi/pom.xml @@ -50,6 +50,11 @@ +org.apache.camel +camel-rest + + + io.apicurio apicurio-data-models ${apicurio-version} diff --git a/components/camel-rest-swagger/pom.xml b/components/camel-rest-swagger/pom.xml index e635573..b06aa28 100644 --- a/components/camel-rest-swagger/pom.xml +++ b/components/camel-rest-swagger/pom.xml @@ -45,6 +45,11 @@ +org.apache.camel +camel-rest + + + io.swagger swagger-parser ${swagger-java-parser-version}
[camel-spring-boot] branch main updated: [CAMEL-17589]also fix this issue up for camel-spring-boot project
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new d081b6e [CAMEL-17589]also fix this issue up for camel-spring-boot project d081b6e is described below commit d081b6ed001a0fa3a97f3eec8e39d5fdea8fe378 Author: Freeman Fang AuthorDate: Mon Feb 7 13:47:17 2022 -0500 [CAMEL-17589]also fix this issue up for camel-spring-boot project --- .../camel/integration/springboot/infinispan/InfinispanTest.java| 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/camel-spring-boot-integration-tests/infinispan/src/test/java/org/apache/camel/integration/springboot/infinispan/InfinispanTest.java b/tests/camel-spring-boot-integration-tests/infinispan/src/test/java/org/apache/camel/integration/springboot/infinispan/InfinispanTest.java index 3c438d6..15d5fcb 100644 --- a/tests/camel-spring-boot-integration-tests/infinispan/src/test/java/org/apache/camel/integration/springboot/infinispan/InfinispanTest.java +++ b/tests/camel-spring-boot-integration-tests/infinispan/src/test/java/org/apache/camel/integration/springboot/infinispan/InfinispanTest.java @@ -35,7 +35,9 @@ import org.infinispan.configuration.cache.CacheMode; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.testcontainers.shaded.org.apache.commons.lang.SystemUtils; +import java.util.Properties; import java.util.Random; import java.util.UUID; @@ -108,6 +110,11 @@ public class InfinispanTest extends SpringBootBaseIntegration { .serverName("infinispan") .saslMechanism("DIGEST-MD5") .realm("default"); + if (SystemUtils.IS_OS_MAC) { + Properties properties = new Properties(); + properties.put("infinispan.client.hotrod.client_intelligence", "BASIC"); + clientBuilder.withProperties(properties); + } return clientBuilder; }
[camel-spring-boot-examples] branch main updated: [CAMEL-17584]camel-spring-boot-examples:xml-import example is broken
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new c18ebd1 [CAMEL-17584]camel-spring-boot-examples:xml-import example is broken c18ebd1 is described below commit c18ebd115d30bad424ccfd904f4d2893bbce69ac Author: Freeman Fang AuthorDate: Tue Feb 1 12:32:36 2022 -0500 [CAMEL-17584]camel-spring-boot-examples:xml-import example is broken --- xml-import/pom.xml | 2 +- xml-import/readme.adoc | 4 ++-- xml-import/src/main/resources/application.properties | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xml-import/pom.xml b/xml-import/pom.xml index a3616d7..eb2d5ec 100644 --- a/xml-import/pom.xml +++ b/xml-import/pom.xml @@ -80,7 +80,7 @@ org.springframework.boot -spring-boot-actuator +spring-boot-starter-actuator diff --git a/xml-import/readme.adoc b/xml-import/readme.adoc index a02346d..a25b161 100644 --- a/xml-import/readme.adoc +++ b/xml-import/readme.adoc @@ -26,13 +26,13 @@ You can run this example using To show a summary of all the routes -curl -XGET -s http://localhost:8080/camel/routes +curl -XGET -s http://localhost:8080/actuator/camelroutes To show detailed information for a specific route -curl -XGET -s http://localhost:8080/camel/routes/{id}/info +curl -XGET -s http://localhost:8080/actuator/camelroutes/{id}/info === Help and contributions diff --git a/xml-import/src/main/resources/application.properties b/xml-import/src/main/resources/application.properties index b4088ad..67115c8 100644 --- a/xml-import/src/main/resources/application.properties +++ b/xml-import/src/main/resources/application.properties @@ -34,6 +34,8 @@ greeting = Hello World # how often to trigger the timer timer.period = 2000 +# expose actuator endpoint via HTTP +management.endpoints.web.exposure.include=camelroutes # turn on actuator health check management.endpoint.health.enabled = true
[camel-spring-boot-examples] branch main updated: [CAMEL-17584]camel-spring-boot-examples:xml example is broken
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new dbfe36b [CAMEL-17584]camel-spring-boot-examples:xml example is broken dbfe36b is described below commit dbfe36b978a22b3b9ef2a6a20a16a969830185e7 Author: Freeman Fang AuthorDate: Tue Feb 1 12:29:11 2022 -0500 [CAMEL-17584]camel-spring-boot-examples:xml example is broken --- xml/pom.xml | 2 +- xml/readme.adoc | 4 ++-- xml/src/main/resources/application.properties | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xml/pom.xml b/xml/pom.xml index d2ed451..3c8044a 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -70,7 +70,7 @@ org.springframework.boot -spring-boot-actuator +spring-boot-starter-actuator diff --git a/xml/readme.adoc b/xml/readme.adoc index a02346d..a25b161 100644 --- a/xml/readme.adoc +++ b/xml/readme.adoc @@ -26,13 +26,13 @@ You can run this example using To show a summary of all the routes -curl -XGET -s http://localhost:8080/camel/routes +curl -XGET -s http://localhost:8080/actuator/camelroutes To show detailed information for a specific route -curl -XGET -s http://localhost:8080/camel/routes/{id}/info +curl -XGET -s http://localhost:8080/actuator/camelroutes/{id}/info === Help and contributions diff --git a/xml/src/main/resources/application.properties b/xml/src/main/resources/application.properties index b4088ad..67115c8 100644 --- a/xml/src/main/resources/application.properties +++ b/xml/src/main/resources/application.properties @@ -34,6 +34,8 @@ greeting = Hello World # how often to trigger the timer timer.period = 2000 +# expose actuator endpoint via HTTP +management.endpoints.web.exposure.include=camelroutes # turn on actuator health check management.endpoint.health.enabled = true
[camel-spring-boot-examples] branch main updated: minor fix for the README.adoc
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new b19eb9e minor fix for the README.adoc b19eb9e is described below commit b19eb9ef129aec99124cba69580b378e9d163262 Author: Freeman Fang AuthorDate: Tue Feb 1 10:59:24 2022 -0500 minor fix for the README.adoc --- rest-swagger/README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-swagger/README.adoc b/rest-swagger/README.adoc index b15697b..3e92e6a 100644 --- a/rest-swagger/README.adoc +++ b/rest-swagger/README.adoc @@ -41,7 +41,7 @@ You should see the following output when the application is launched: 2017-03-05 14:55:44.140 INFO 15312 --- [ main] o.a.c.example.springboot.Application : Started Application in 6.265 seconds (JVM running for 21.092) -After the Spring Boot application is started, you can open the following URL in your web browser to access the REST endpoint and retrieve a list of users: http://localhost:8080/camel/users +After the Spring Boot application is started, you can open the following URL in your web browser to access the REST endpoint and retrieve a list of users: http://localhost:8080/api/users You can also access the REST endpoint from the command line:
[camel-spring-boot-examples] branch main updated: minor fix for the README.adoc
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new e12f2fb minor fix for the README.adoc e12f2fb is described below commit e12f2fb72871a2db585e42e590274b84264a Author: Freeman Fang AuthorDate: Tue Feb 1 10:54:37 2022 -0500 minor fix for the README.adoc --- rest-openapi/README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-openapi/README.adoc b/rest-openapi/README.adoc index b205177..d7b3d48 100644 --- a/rest-openapi/README.adoc +++ b/rest-openapi/README.adoc @@ -41,7 +41,7 @@ You should see the following output when the application is launched: 2017-03-05 14:55:44.140 INFO 15312 --- [ main] o.a.c.example.springboot.Application : Started Application in 6.265 seconds (JVM running for 21.092) -After the Spring Boot application is started, you can open the following URL in your web browser to access the REST endpoint and retrieve a list of users: http://localhost:8080/camel/users +After the Spring Boot application is started, you can open the following URL in your web browser to access the REST endpoint and retrieve a list of users: http://localhost:8080/api/users You can also access the REST endpoint from the command line:
[camel-spring-boot-examples] branch main updated: [CAMEL-17557]fix up undertow-spring-security camel-spring-boot-example
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new ad20200 [CAMEL-17557]fix up undertow-spring-security camel-spring-boot-example ad20200 is described below commit ad20200714cd6a08f1efabb64409da53bf2c8d19 Author: Freeman Fang AuthorDate: Thu Jan 27 12:03:59 2022 -0500 [CAMEL-17557]fix up undertow-spring-security camel-spring-boot-example --- undertow-spring-security/pom.xml | 5 + 1 file changed, 5 insertions(+) diff --git a/undertow-spring-security/pom.xml b/undertow-spring-security/pom.xml index bcea76b..68643dc 100644 --- a/undertow-spring-security/pom.xml +++ b/undertow-spring-security/pom.xml @@ -59,6 +59,11 @@ org.apache.camel.springboot camel-undertow-spring-security-starter + +org.apache.camel.springboot +camel-bean-starter + +
[camel-spring-boot-examples] branch main updated: [CAMEL-17500]fix up camel-springboot-example broken by API refactor
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new 90e1c2a [CAMEL-17500]fix up camel-springboot-example broken by API refactor 90e1c2a is described below commit 90e1c2aedda0fabced86e04ab9e622ee0628beca Author: Freeman Fang AuthorDate: Thu Jan 27 09:39:44 2022 -0500 [CAMEL-17500]fix up camel-springboot-example broken by API refactor --- .../example/springboot/numbers/participants/RoutingParticipant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dynamic-router-eip/src/main/java/org/apache/camel/example/springboot/numbers/participants/RoutingParticipant.java b/dynamic-router-eip/src/main/java/org/apache/camel/example/springboot/numbers/participants/RoutingParticipant.java index 1790496..62d7b25 100644 --- a/dynamic-router-eip/src/main/java/org/apache/camel/example/springboot/numbers/participants/RoutingParticipant.java +++ b/dynamic-router-eip/src/main/java/org/apache/camel/example/springboot/numbers/participants/RoutingParticipant.java @@ -19,8 +19,8 @@ package org.apache.camel.example.springboot.numbers.participants; import org.apache.camel.Consume; import org.apache.camel.Predicate; import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.dynamicrouter.message.DynamicRouterControlMessage; -import org.apache.camel.component.dynamicrouter.message.DynamicRouterControlMessage.SubscribeMessageBuilder; +import org.apache.camel.component.dynamicrouter.DynamicRouterControlMessage; +import org.apache.camel.component.dynamicrouter.DynamicRouterControlMessage.SubscribeMessageBuilder; import org.apache.camel.example.springboot.numbers.config.ExampleConfig; import org.apache.camel.example.springboot.numbers.service.ResultsService;
[camel-spring-boot] branch main updated: [CAMEL-17545]camel elasticsearch rest on spring boot - class not found error
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 6137d5c [CAMEL-17545]camel elasticsearch rest on spring boot - class not found error 6137d5c is described below commit 6137d5c5cd99d81591972e567195620d75154301 Author: Freeman Fang AuthorDate: Wed Jan 26 09:46:30 2022 -0500 [CAMEL-17545]camel elasticsearch rest on spring boot - class not found error --- .../camel-elasticsearch-rest-starter/pom.xml | 26 ++ 1 file changed, 26 insertions(+) diff --git a/components-starter/camel-elasticsearch-rest-starter/pom.xml b/components-starter/camel-elasticsearch-rest-starter/pom.xml index 32ee45f..874d8ef 100644 --- a/components-starter/camel-elasticsearch-rest-starter/pom.xml +++ b/components-starter/camel-elasticsearch-rest-starter/pom.xml @@ -28,12 +28,38 @@ jar Camel SB Starters :: ElasticSearch :: REST Spring-Boot Starter for Camel ElasticSearch REST support + + + org.springframework.boot spring-boot-starter ${spring-boot-version} + + + + org.elasticsearch.client + elasticsearch-rest-high-level-client + ${elasticsearch-rest-version} + + + org.elasticsearch.client + elasticsearch-rest-client-sniffer + ${elasticsearch-rest-version} + + + org.elasticsearch + elasticsearch + ${elasticsearch-rest-version} + + + org.elasticsearch.client + elasticsearch-rest-client + ${elasticsearch-rest-version} + + org.apache.camel camel-elasticsearch-rest
[camel-spring-boot] branch main updated: [CAMEL-17499]fix SpringBootRuntimeProviderTest
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git The following commit(s) were added to refs/heads/main by this push: new 7e90f35 [CAMEL-17499]fix SpringBootRuntimeProviderTest 7e90f35 is described below commit 7e90f353f42993665dd67216fbca9ca8095f7ea2 Author: Freeman Fang AuthorDate: Tue Jan 25 09:13:58 2022 -0500 [CAMEL-17499]fix SpringBootRuntimeProviderTest --- .../apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java b/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java index 29ac1f1..f62f019 100644 --- a/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java +++ b/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java @@ -86,7 +86,6 @@ public class SpringBootRuntimeProviderTest { assertNotNull(names); assertFalse(names.isEmpty()); -assertTrue(names.contains("simple")); assertTrue(names.contains("spel")); assertTrue(names.contains("xpath")); }
[camel] branch main updated: [CAMEL-17546]Introduce camel.failsafe.forkTimeout property for maven-failsafe-plugin
This is an automated email from the ASF dual-hosted git repository. ffang 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 91b3ac0 [CAMEL-17546]Introduce camel.failsafe.forkTimeout property for maven-failsafe-plugin 91b3ac0 is described below commit 91b3ac0e65d06083db80edb86adff4e0596c6e07 Author: Freeman Fang AuthorDate: Mon Jan 24 16:47:05 2022 -0500 [CAMEL-17546]Introduce camel.failsafe.forkTimeout property for maven-failsafe-plugin --- components/pom.xml | 2 +- parent/pom.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/pom.xml b/components/pom.xml index e1301d6..197f071 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -384,7 +384,7 @@ true - 300 + ${camel.failsafe.forkTimeout} false true diff --git a/parent/pom.xml b/parent/pom.xml index b0310df..a0d2cec 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -43,6 +43,7 @@ false 1 dynamic +600 false false
[camel] branch camel-3.14.x updated: [CAMEL-17526]camel-fhir: the serverUrl configuration on camel-fhir endpoint shouldn't be ignored (#6796)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch camel-3.14.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-3.14.x by this push: new 215a545 [CAMEL-17526]camel-fhir: the serverUrl configuration on camel-fhir endpoint shouldn't be ignored (#6796) 215a545 is described below commit 215a545f31c1f04a551fad9ab9a5352b83b1307d Author: Freeman(Yue) Fang AuthorDate: Fri Jan 21 01:01:56 2022 -0500 [CAMEL-17526]camel-fhir: the serverUrl configuration on camel-fhir endpoint shouldn't be ignored (#6796) (cherry picked from commit ddfba2e83e505fa72e0e7864b686b5853a62162f) --- .../apache/camel/component/fhir/FhirCreateIT.java | 38 -- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirCreateIT.java b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirCreateIT.java index 0c09d5c..8ca2bf0 100644 --- a/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirCreateIT.java +++ b/components/camel-fhir/camel-fhir-component/src/test/java/org/apache/camel/component/fhir/FhirCreateIT.java @@ -19,11 +19,16 @@ package org.apache.camel.component.fhir; import java.util.HashMap; import java.util.Map; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.rest.api.MethodOutcome; +import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.fhir.api.ExtraParameters; import org.apache.camel.component.fhir.internal.FhirApiCollection; import org.apache.camel.component.fhir.internal.FhirCreateApiMethod; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.spi.Registry; import org.hl7.fhir.dstu3.model.HumanName; import org.hl7.fhir.dstu3.model.Patient; import org.junit.jupiter.api.Test; @@ -42,6 +47,32 @@ public class FhirCreateIT extends AbstractFhirTestSupport { private static final Logger LOG = LoggerFactory.getLogger(FhirCreateIT.class); private static final String PATH_PREFIX = FhirApiCollection.getCollection().getApiName(FhirCreateApiMethod.class).getName(); +@Override +protected CamelContext createCamelContext() throws Exception { +//don't set serverUrl on component, use it from endpoint configration +Registry registry = createCamelRegistry(); + +if (registry != null) { +context = new DefaultCamelContext(registry); +} else { +context = new DefaultCamelContext(); +} + +this.fhirContext = new FhirContext(FhirVersionEnum.DSTU3); +// Set proxy so that FHIR resource URLs returned by the server are using the correct host and port +this.fhirContext.getRestfulClientFactory().setProxy(service.getHost(), service.getPort()); +this.fhirClient = this.fhirContext.newRestfulGenericClient(service.getServiceBaseURL()); +final FhirConfiguration configuration = new FhirConfiguration(); + +configuration.setFhirContext(this.fhirContext); + +// add FhirComponent to Camel context +final FhirComponent component = new FhirComponent(context); +component.setConfiguration(configuration); +context.addComponent("fhir", component); +return context; +} + @Test public void testCreateResource() throws Exception { Patient patient = new Patient().addName(new HumanName().addGiven("Vincent").setFamily("Freeman")); @@ -83,12 +114,15 @@ public class FhirCreateIT extends AbstractFhirTestSupport { return new RouteBuilder() { public void configure() { // test route for resource +String serverUrl = service.getServiceBaseURL(); from("direct://RESOURCE") -.to("fhir://" + PATH_PREFIX + "/resource?inBody=resource"); +.to("fhir://" + PATH_PREFIX + "/resource?inBody=resource&serverUrl=" ++ serverUrl); // test route for resource from("direct://RESOURCE_STRING") -.to("fhir://" + PATH_PREFIX + "/resource?inBody=resourceAsString&log=true"); +.to("fhir://" + PATH_PREFIX + "/resource?inBody=resourceAsString&log=true&serverUrl=" ++ serverUrl); } };
[camel-spring-boot-examples] branch main updated: [CAMEL-17523]camel-spring-boot-examples:rest-jpa is broken (#45)
This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git The following commit(s) were added to refs/heads/main by this push: new 4d817d9 [CAMEL-17523]camel-spring-boot-examples:rest-jpa is broken (#45) 4d817d9 is described below commit 4d817d90fe30d90491629e073f7db6476bb8f024 Author: Freeman(Yue) Fang AuthorDate: Thu Jan 20 13:31:44 2022 -0500 [CAMEL-17523]camel-spring-boot-examples:rest-jpa is broken (#45) --- rest-jpa/src/main/resources/application-dev.yml | 2 ++ rest-jpa/src/main/resources/data.sql| 9 - rest-jpa/src/test/resources/application.yml | 6 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/rest-jpa/src/main/resources/application-dev.yml b/rest-jpa/src/main/resources/application-dev.yml index 8e6d62d..6cac4ce 100644 --- a/rest-jpa/src/main/resources/application-dev.yml +++ b/rest-jpa/src/main/resources/application-dev.yml @@ -33,6 +33,8 @@ spring: jpa: database: h2 database-platform: org.hibernate.dialect.H2Dialect +hibernate: + ddl-auto: update # The application configuration properties example: diff --git a/rest-jpa/src/main/resources/data.sql b/rest-jpa/src/main/resources/data.sql index b4dc5bc..78b70f7 100644 --- a/rest-jpa/src/main/resources/data.sql +++ b/rest-jpa/src/main/resources/data.sql @@ -15,7 +15,14 @@ -- limitations under the License. -- +create table books ( + id integer not null, +description varchar(255), +item varchar(255), +primary key (id) +); + INSERT INTO books (id, item, description) VALUES (1, 'Camel','Camel in Action'), - (2, 'ActiveMQ', 'ActiveMQ in Action'); \ No newline at end of file + (2, 'ActiveMQ', 'ActiveMQ in Action'); diff --git a/rest-jpa/src/test/resources/application.yml b/rest-jpa/src/test/resources/application.yml index 714fe90..2a5d066 100644 --- a/rest-jpa/src/test/resources/application.yml +++ b/rest-jpa/src/test/resources/application.yml @@ -22,6 +22,12 @@ camel: mapping: contextPath: /camel-rest-jpa/* +spring: + jpa: +hibernate: + ddl-auto: update + + example: generateOrderPeriod: 1000 processOrderPeriod: 3000