Author: davsclaus Date: Mon Apr 23 06:11:11 2012 New Revision: 1329079 URL: http://svn.apache.org/viewvc?rev=1329079&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/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java?rev=1329079&r1=1329078&r2=1329079&view=diff ============================================================================== --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java (original) +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/CxfEndpointBeansRouterTest.java Mon Apr 23 06:11:11 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