Author: ningjiang
Date: Mon Apr  1 07:56:19 2013
New Revision: 1463108

URL: http://svn.apache.org/r1463108
Log:
Added more test on CxfEndpoint

Modified:
    
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
    
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml

Modified: 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java?rev=1463108&r1=1463107&r2=1463108&view=diff
==============================================================================
--- 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanTest.java
 Mon Apr  1 07:56:19 2013
@@ -18,6 +18,7 @@ package org.apache.camel.component.cxf.s
 
 import javax.xml.namespace.QName;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.component.cxf.CXFTestSupport;
 import org.apache.camel.component.cxf.CxfEndpoint;
 import org.apache.camel.component.cxf.CxfProducer;
@@ -68,6 +69,20 @@ public class CxfEndpointBeanTest extends
     }
     
     @Test
+    public void testCxfEndpointsWithCamelContext() {
+        CamelContext context = ctx.getBean("myCamelContext", 
CamelContext.class);
+        // try to create a new CxfEndpoint which could override the old bean's 
setting
+        CxfEndpoint myLocalCxfEndpoint = 
(CxfEndpoint)context.getEndpoint("cxf:bean:routerEndpoint?address=http://localhost:";
 
+        + port1 + "/CxfEndpointBeanTest/myCamelContext/");
+        assertEquals("Got the wrong endpoint address", "http://localhost:"; + 
port1 
+                + "/CxfEndpointBeanTest/myCamelContext/", 
myLocalCxfEndpoint.getAddress());
+
+        CxfEndpoint routerEndpoint = ctx.getBean("routerEndpoint", 
CxfEndpoint.class);
+        assertEquals("Got the wrong endpoint address", "http://localhost:"; + 
port1 
+                     + "/CxfEndpointBeanTest/router", 
routerEndpoint.getAddress());
+    }
+    
+    @Test
     public void testPropertiesSettingOnCxfClient() throws Exception {
         CxfEndpoint clientEndpoint = ctx.getBean("clientEndpoint", 
CxfEndpoint.class);
         CxfProducer producer = (CxfProducer) clientEndpoint.createProducer();

Modified: 
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml?rev=1463108&r1=1463107&r2=1463108&view=diff
==============================================================================
--- 
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml
 (original)
+++ 
camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml
 Mon Apr  1 07:56:19 2013
@@ -61,7 +61,7 @@
     </cxf:binding>
   </cxf:cxfEndpoint>
 
-  <camelContext xmlns="http://camel.apache.org/schema/spring";>
+  <camelContext id="myCamelContext" 
xmlns="http://camel.apache.org/schema/spring";>
      <route>
         <from uri="direct:start" />
         <to uri="cxf:bean:myEndpoint" />


Reply via email to