camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1221565 - in /camel/trunk/components: camel-cache/src/test/java/org/apache/camel/component/cache/ camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/ camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/ camel-cxf/src/tes...
Date Wed, 21 Dec 2011 02:22:23 GMT
Author: ningjiang
Date: Wed Dec 21 02:22:22 2011
New Revision: 1221565

URL: http://svn.apache.org/viewvc?rev=1221565&view=rev
Log:
CAMEL-4788 Fixed the issue of setting the bean address with thanks to C├ędric

Modified:
    camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheManagerFactoryRefTest.java
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.java
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.xml
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/testEndpoint.properties

Modified: camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheManagerFactoryRefTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheManagerFactoryRefTest.java?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheManagerFactoryRefTest.java
(original)
+++ camel/trunk/components/camel-cache/src/test/java/org/apache/camel/component/cache/CacheManagerFactoryRefTest.java
Wed Dec 21 02:22:22 2011
@@ -38,11 +38,12 @@ public class CacheManagerFactoryRefTest 
     @Produce(uri = "direct:start")
     protected ProducerTemplate producerTemplate;
 
-    private CacheManagerFactory testingCacheManagerFactory = new TestingCacheManagerFactory();
+    protected CacheManagerFactory testingCacheManagerFactory;
 
     @Override
     protected JndiRegistry createRegistry() throws Exception {
         JndiRegistry jndi = super.createRegistry();
+        testingCacheManagerFactory = new TestingCacheManagerFactory();
         jndi.bind("testCacheManagerFactory", testingCacheManagerFactory);
         return jndi;
     }

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
(original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java
Wed Dec 21 02:22:22 2011
@@ -52,6 +52,8 @@ public class CxfRsBlueprintEndpoint exte
         super(uri, comp);
         this.bean = bean;
         setAddress(bean.getAddress());
+        // update the sfb address by resolving the properties
+        bean.setAddress(getAddress());
         BlueprintSupport support = (BlueprintSupport)bean;
         setBlueprintContainer(support.getBlueprintContainer());
         setBundleContext(support.getBundleContext());

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
(original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpoint.java
Wed Dec 21 02:22:22 2011
@@ -40,6 +40,8 @@ public class CxfRsSpringEndpoint extends
     public CxfRsSpringEndpoint(Component component, String uri, AbstractJAXRSFactoryBean
bean) throws Exception {
         super(uri, component);
         setAddress(bean.getAddress());
+        // Update the sfb address by resolving the properties
+        bean.setAddress(getAddress());
         init(bean);
     }
     
@@ -52,7 +54,7 @@ public class CxfRsSpringEndpoint extends
     
     @Override
     protected void setupJAXRSServerFactoryBean(JAXRSServerFactoryBean sfb) {
-        // Do nothing here
+       // Do nothing here
     }
     
     @Override

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.java?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.java
(original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.java
Wed Dec 21 02:22:22 2011
@@ -18,6 +18,9 @@ package org.apache.camel.component.cxf.j
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.cxf.spring.AbstractSpringBeanTestSupport;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.DefaultHttpClient;
 import org.junit.Test;
 
 public class CxfRsEndpointWithProperties extends AbstractSpringBeanTestSupport {
@@ -32,7 +35,11 @@ public class CxfRsEndpointWithProperties
         // get the camelContext from application context
         CamelContext camelContext = ctx.getBean("camel", CamelContext.class);
         CxfRsEndpoint testEndpoint = camelContext.getEndpoint("cxfrs:bean:testEndpoint",
CxfRsEndpoint.class);
-        assertEquals("Got a wrong address", "http://localhost:9000/testEndpoint", testEndpoint.getAddress());
+        assertEquals("Got a wrong address", "http://localhost:9900/testEndpoint", testEndpoint.getAddress());
+        HttpGet get = new HttpGet(testEndpoint.getAddress());
+        DefaultHttpClient httpclient = new DefaultHttpClient();
+        HttpResponse response = httpclient.execute(get);
+        assertEquals(404, response.getStatusLine().getStatusCode());
     }
 
 }

Modified: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.xml?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.xml
(original)
+++ camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointWithProperties.xml
Wed Dec 21 02:22:22 2011
@@ -32,6 +32,10 @@
  
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
   	<propertyPlaceholder id="properties" location="org/apache/camel/component/cxf/jaxrs/testEndpoint.properties"/>
+  	<route>
+  		<from uri="cxfrs:bean:testEndpoint"/>
+		<to uri="mock:end"/>
+  	</route>
   </camelContext>
   
   

Modified: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/testEndpoint.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/testEndpoint.properties?rev=1221565&r1=1221564&r2=1221565&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/testEndpoint.properties
(original)
+++ camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/testEndpoint.properties
Wed Dec 21 02:22:22 2011
@@ -18,4 +18,4 @@
 #    under the License.
 #
 #
-address=http://localhost:9000/testEndpoint
+address=http://localhost:9900/testEndpoint



Mime
View raw message