camel git commit: CAMEL-9366: skipFaultLogging attribute does not work on Spring rsClient/rsServer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

camel git commit: CAMEL-9366: skipFaultLogging attribute does not work on Spring rsClient/rsServer

gertv-2
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 2d5878d21 -> 5347e630a


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/5347e630
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5347e630
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5347e630

Branch: refs/heads/camel-2.15.x
Commit: 5347e630a08cb71ee8ef329072641b7d8fc4895d
Parents: 2d5878d
Author: Gert Vanthienen <[hidden email]>
Authored: Thu Nov 26 12:42:20 2015 +0100
Committer: Gert Vanthienen <[hidden email]>
Committed: Thu Nov 26 13:40:22 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/5347e630/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/5347e630/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/5347e630/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="<a href="http://localhost:$">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>