Author: davsclaus
Date: Mon Apr 23 06:12:36 2012
New Revision: 1329080
URL: http://svn.apache.org/viewvc?rev=1329080&view=rev
Log:
CAMEL-5177: getEndpointUri returns the exact uri the endpoint was given. Avoid
reparsing as well. Polished EndpointConfiguration to avoid using
PropertyEditorTypeConverter directly.
Modified:
camel/branches/camel-2.9.x/ (props changed)
camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1329079
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java?rev=1329080&r1=1329079&r2=1329080&view=diff
==============================================================================
---
camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
(original)
+++
camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java
Mon Apr 23 06:12:36 2012
@@ -28,6 +28,7 @@ import org.apache.camel.ProducerTemplate
import org.apache.camel.component.cxf.CXFTestSupport;
import org.apache.camel.component.cxf.CxfEndpoint;
import org.apache.camel.component.cxf.common.message.CxfConstants;
+import org.apache.camel.util.URISupport;
import org.apache.cxf.transport.http.HTTPException;
import org.junit.Test;
@@ -50,14 +51,19 @@ public class CxfEndpointBeansRouterTest
}
@Test
- public void testCreateCxfEndpointFromURI() {
+ public void testCreateCxfEndpointFromURI() throws Exception {
CamelContext camelContext = ctx.getBean("camel", CamelContext.class);
+
CxfEndpoint endpoint1 =
camelContext.getEndpoint("cxf:bean:routerEndpoint?address=http://localhost:9000/test1",
CxfEndpoint.class);
CxfEndpoint endpoint2 =
camelContext.getEndpoint("cxf:bean:routerEndpoint?address=http://localhost:8000/test2",
CxfEndpoint.class);
assertEquals("Get a wrong endpoint address.",
"http://localhost:9000/test1", endpoint1.getAddress());
assertEquals("Get a wrong endpoint address.",
"http://localhost:8000/test2", endpoint2.getAddress());
- assertEquals("Get a wrong endpoint key.",
"cxf://bean:routerEndpoint?address=http://localhost:9000/test1",
endpoint1.getEndpointKey());
- assertEquals("Get a wrong endpoint key.",
"cxf://bean:routerEndpoint?address=http://localhost:8000/test2",
endpoint2.getEndpointKey());
+
+ // the uri will always be normalized
+ String uri1 =
URISupport.normalizeUri("cxf://bean:routerEndpoint?address=http://localhost:9000/test1");
+ String uri2 =
URISupport.normalizeUri("cxf://bean:routerEndpoint?address=http://localhost:8000/test2");
+ assertEquals("Get a wrong endpoint key.", uri1,
endpoint1.getEndpointKey());
+ assertEquals("Get a wrong endpoint key.", uri2,
endpoint2.getEndpointKey());
}
@Test