Author: ningjiang
Date: Sun Mar 25 14:09:53 2012
New Revision: 1305040

URL: http://svn.apache.org/viewvc?rev=1305040&view=rev
Log:
Merged revisions 1305037 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.9.x

................
  r1305037 | ningjiang | 2012-03-25 21:57:10 +0800 (Sun, 25 Mar 2012) | 9 lines
  
  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.8.x/   (props changed)
    
camel/branches/camel-2.8.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
    
camel/branches/camel-2.8.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
    
camel/branches/camel-2.8.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml

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

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

Modified: 
camel/branches/camel-2.8.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.8.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java?rev=1305040&r1=1305039&r2=1305040&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
 Sun Mar 25 14:09:53 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.8.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.8.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java?rev=1305040&r1=1305039&r2=1305040&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
 Sun Mar 25 14:09:53 2012
@@ -24,6 +24,7 @@ import javax.xml.ws.Holder;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
+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;
@@ -76,9 +77,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.8.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.8.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml?rev=1305040&r1=1305039&r2=1305040&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
 (original)
+++ 
camel/branches/camel-2.8.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml
 Sun Mar 25 14:09:53 2012
@@ -69,6 +69,7 @@
                <route>
                        <from 
uri="jetty:http://localhost:9000?matchOnUriPrefix=true"; />
                        <to uri="cxfbean:customerServiceBean" />
+                       <to uri="mock:endpointA" />
                </route>
                <!-- END SNIPPET: routeDefinition -->   
                <route>


Reply via email to