Repository: camel Updated Branches: refs/heads/camel-2.16.x 9d4f7abb6 -> 083b89bfa
CAMEL-9366: skipFaultLogging attribute does not work on Spring rsClient/rsServer Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/083b89bf Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/083b89bf Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/083b89bf Branch: refs/heads/camel-2.16.x Commit: 083b89bfadfb7c9436347d43199fc92516abaaa5 Parents: 9d4f7ab Author: Gert Vanthienen <ge...@apache.org> Authored: Thu Nov 26 12:42:20 2015 +0100 Committer: Gert Vanthienen <ge...@apache.org> Committed: Thu Nov 26 13:32:14 2015 +0100 ---------------------------------------------------------------------- .../component/cxf/spring/SpringJAXRSClientFactoryBean.java | 9 +++++++++ .../component/cxf/spring/CxfRsClientFactoryBeanTest.java | 5 +++++ .../camel/component/cxf/spring/CxfRsClientFactoryBeans.xml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/083b89bf/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java index 7ed503e..3335cc5 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java @@ -18,6 +18,7 @@ package org.apache.camel.component.cxf.spring; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.camel.component.cxf.NullFaultListener; import org.apache.camel.component.cxf.jaxrs.BeanIdAware; @@ -105,4 +106,12 @@ public class SpringJAXRSClientFactoryBean extends JAXRSClientFactoryBean this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); } } + + public void setProperties(Map<String, Object> properties) { + if (this.getProperties() != null && properties != null) { + this.getProperties().putAll(properties); + } else { + super.setProperties(properties); + } + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/083b89bf/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java index 9d543e2..b5f9240 100644 --- a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java +++ b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanTest.java @@ -17,7 +17,9 @@ package org.apache.camel.component.cxf.spring; import org.apache.camel.component.cxf.CXFTestSupport; +import org.apache.camel.component.cxf.NullFaultListener; import org.apache.camel.component.cxf.jaxrs.testbean.CustomerService; +import org.apache.cxf.logging.FaultListener; import org.junit.Test; public class CxfRsClientFactoryBeanTest extends AbstractSpringBeanTestSupport { @@ -41,6 +43,9 @@ public class CxfRsClientFactoryBeanTest extends AbstractSpringBeanTestSupport { assertEquals("Got the wrong schemalocation", "classpath:wsdl/Message.xsd", cfb.getSchemaLocations().get(0)); assertEquals("Got the wrong loggingFeatureEnabled", true, cfb.isLoggingFeatureEnabled()); assertEquals("Got the wrong loggingSizeLimit", 200, cfb.getLoggingSizeLimit()); + Object listener = cfb.getProperties().get(FaultListener.class.getName()); + assertTrue("NullFaultListener was not added to the properties", listener instanceof NullFaultListener); } } + http://git-wip-us.apache.org/repos/asf/camel/blob/083b89bf/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml index c9929ae..156bf88 100644 --- a/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml +++ b/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeans.xml @@ -28,7 +28,7 @@ <cxf:rsClient id="rsClient1" address="http://localhost:${CXFTestSupport.port1}/CxfRsClientFactoryBeanTest/router" serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService" username="username" password="passwd" - loggingFeatureEnabled="true" loggingSizeLimit="200"> + loggingFeatureEnabled="true" loggingSizeLimit="200" skipFaultLogging="true"> <cxf:schemaLocations> <cxf:schemaLocation>classpath:wsdl/Message.xsd</cxf:schemaLocation> </cxf:schemaLocations>