camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r713938 - in /activemq/camel/branches/camel-1.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/
Date Fri, 14 Nov 2008 06:54:39 GMT
Author: ningjiang
Date: Thu Nov 13 22:54:39 2008
New Revision: 713938

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

........
  r713932 | ningjiang | 2008-11-14 14:44:12 +0800 (Fri, 14 Nov 2008) | 1 line
  
  CAMEL-1086 Applied patch with thanks to William
........

Modified:
    activemq/camel/branches/camel-1.x/   (props changed)
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/CxfClient.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/TestCxfFeature.java

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 13 22:54:39 2008
@@ -1 +1 @@
-/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625
+/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932

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

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/CxfClient.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/CxfClient.java?rev=713938&r1=713937&r2=713938&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/CxfClient.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/CxfClient.java
Thu Nov 13 22:54:39 2008
@@ -98,7 +98,6 @@
 
         Exchange exchange = new ExchangeImpl();
         // put the message Observer to call the CxfClient onMessage()
-        setExchangeProperties(exchange, getEndpoint(), bi);
         exchange.put(InvokingContext.class, invokingContext);
 
         if (bi != null) {
@@ -118,6 +117,7 @@
             message.putAll(ep);
         }
 
+        setExchangeProperties(exchange, ep, bi);
         PhaseInterceptorChain chain = setupInterceptorChain(getEndpoint());
 
         message.setInterceptorChain(chain);
@@ -209,3 +209,4 @@
 
 }
 
+

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java?rev=713938&r1=713937&r2=713938&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfGreeterPayLoadWithFeatureRouterTest.java
Thu Nov 13 22:54:39 2008
@@ -16,13 +16,12 @@
  */
 package org.apache.camel.component.cxf;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.spring.processor.SpringTestHelper;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
  * The Greeter Payload mode test that is configured with CXF features.
  */
-public class CxfGreeterPayLoadWithFeatureRouterTest  extends CXFGreeterRouterTest {
+public class CxfGreeterPayLoadWithFeatureRouterTest extends CXFGreeterRouterTest {
 
     @Override
     protected void setUp() throws Exception {
@@ -35,11 +34,12 @@
         assertEquals(TestCxfFeature.class, endpoint.getCxfEndpointBean().getFeatures().get(0).getClass());
         assertEquals(DataFormat.PAYLOAD.toString(), endpoint.getDataFormat());
     }   
-    
+
     @Override
-    protected CamelContext createCamelContext() throws Exception {
-        return SpringTestHelper.createSpringCamelContext(this, 
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext(
                 "org/apache/camel/component/cxf/GreeterEndpointWithFeatureBeans.xml");
     }
 
+
 }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/TestCxfFeature.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/TestCxfFeature.java?rev=713938&r1=713937&r2=713938&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/TestCxfFeature.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/TestCxfFeature.java
Thu Nov 13 22:54:39 2008
@@ -16,8 +16,48 @@
  */
 package org.apache.camel.component.cxf;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.InterceptorProvider;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
 
 public class TestCxfFeature extends AbstractFeature {
+    
+    
+    @Override
+    protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+            
+        if (provider instanceof Client) {
+            provider = ((Client)provider).getEndpoint();
+        }
+        
+        provider.getOutInterceptors().add(new EndpointCheckInterceptor());
+                
+    }
+    
+    class EndpointCheckInterceptor extends AbstractPhaseInterceptor<Message> {
+
+        public EndpointCheckInterceptor() {
+            super(Phase.PREPARE_SEND);
+        }
+
+        public void handleMessage(Message message) throws Fault {
+            Exchange ex = message.getExchange();
+            
+            // This test verifies that the "to" endpoint is not the from endpoint.
+            Endpoint endpoint = ex.get(Endpoint.class);
+            if ("http://localhost:9003/CamelContext/RouterPort".equals(endpoint.getEndpointInfo().getAddress()))
{
+                throw new Fault(new Exception("bad endpoint " + endpoint.getEndpointInfo().getAddress()));
+            }
+            
+        }
+    }
+
 
 }



Mime
View raw message