camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1305037 - in /camel/branches/camel-2.9.x: ./ components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/ components/camel-cxf/src/te...
Date Sun, 25 Mar 2012 13:57:10 GMT
Author: ningjiang
Date: Sun Mar 25 13:57:10 2012
New Revision: 1305037

URL: http://svn.apache.org/viewvc?rev=1305037&view=rev
Log:
Merged revisions 1305007 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1305007 | ningjiang | 2012-03-25 19:30:13 +0800 (Sun, 25 Mar 2012) | 1 line
  
  CAMEL-5115 CxfBeanDestination should copy the in message header to the out message
........

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
    camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
    camel/branches/camel-2.9.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
    camel/branches/camel-2.9.x/components/camel-solr/   (props changed)

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1305007

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java?rev=1305037&r1=1305036&r2=1305037&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
Sun Mar 25 13:57:10 2012
@@ -80,6 +80,8 @@ public class DefaultCxfMesssageMapper im
         }
 
         Map<String, Object> camelHeaders = exchange.getOut().getHeaders();
+        // copy the in message header to out message
+        camelHeaders.putAll(exchange.getIn().getHeaders());
         
         Map<String, List<String>> cxfHeaders =
             CastUtils.cast((Map<?, ?>)cxfMessage.get(Message.PROTOCOL_HEADERS));

Modified: camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java?rev=1305037&r1=1305036&r2=1305037&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
Sun Mar 25 13:57:10 2012
@@ -26,6 +26,7 @@ import javax.xml.ws.Holder;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.cxf.CXFTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.wsdl_first.Person;
 import org.apache.camel.wsdl_first.PersonService;
 import org.apache.http.HttpResponse;
@@ -80,9 +81,21 @@ public class CxfBeanTest extends Abstrac
         assertTrue(testedEndpointWithProviders);
     }
     
+    @Test
+    public void testMessageHeadersAfterCxfBeanEndpoint() throws Exception {
+        MockEndpoint endpoint = (MockEndpoint)camelContext.getEndpoint("mock:endpointA");
+        endpoint.reset();
+        invokeRsService("http://localhost:" + PORT1 + "/customerservice/customers/123",
+            "{\"Customer\":{\"id\":123,\"name\":\"John\"}}");
+        endpoint.expectedMessageCount(1);
+        endpoint.expectedHeaderReceived("key", "customer");
+        endpoint.assertIsSatisfied();
+    }
+    
     private void invokeRsService(String getUrl, String expected) throws Exception {
         HttpGet get = new HttpGet(getUrl);
         get.addHeader("Accept" , "application/json");
+        get.addHeader("key", "customer");
         HttpClient httpclient = new DefaultHttpClient();
 
         try {

Modified: camel/branches/camel-2.9.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml?rev=1305037&r1=1305036&r2=1305037&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
(original)
+++ camel/branches/camel-2.9.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
Sun Mar 25 13:57:10 2012
@@ -75,6 +75,7 @@
 		<route>
 			<from ref="ep1" />
 			<to uri="cxfbean:customerServiceBean" />
+			<to uri="mock:endpointA" />
 		</route>
 		<!-- END SNIPPET: routeDefinition -->	
 		<route>

Propchange: camel/branches/camel-2.9.x/components/camel-solr/
------------------------------------------------------------------------------
  Merged /camel/trunk/components/camel-solr:r1305007



Mime
View raw message