camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1326939 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/impl/DefaultCamelContext.java test/java/org/apache/camel/component/ref/RefInvalidTest.java test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
Date Tue, 17 Apr 2012 06:13:42 GMT
Author: davsclaus
Date: Tue Apr 17 06:13:41 2012
New Revision: 1326939

URL: http://svn.apache.org/viewvc?rev=1326939&view=rev
Log:
Bad idea, the uri should be normalized as custom components would rely on this behavior

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/ref/RefInvalidTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1326939&r1=1326938&r2=1326939&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Tue
Apr 17 06:13:41 2012
@@ -426,13 +426,14 @@ public class DefaultCamelContext extends
             throw new ResolveEndpointFailedException(uri, e);
         }
 
-        // endpoint key will normalize uri so we can do endpoint hits with minor mistakes
and parameters is not in the same order
-        // and also validate the uri, if the uri is invalid an ResolveEndpointFailedException
is thrown from the getEndpointKey
-        EndpointKey key = getEndpointKey(uri);
-        log.trace("Getting endpoint with normalized uri: {}", key);
+        // normalize uri so we can do endpoint hits with minor mistakes and parameters is
not in the same order
+        uri = normalizeEndpointUri(uri);
+
+        log.trace("Getting endpoint with normalized uri: {}", uri);
 
         Endpoint answer;
         String scheme = null;
+        EndpointKey key = getEndpointKey(uri);
         answer = endpoints.get(key);
         if (answer == null) {
             try {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/ref/RefInvalidTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/ref/RefInvalidTest.java?rev=1326939&r1=1326938&r2=1326939&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/ref/RefInvalidTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/ref/RefInvalidTest.java
Tue Apr 17 06:13:41 2012
@@ -44,7 +44,7 @@ public class RefInvalidTest extends Cont
             template.sendBody("ref:xxx", "Hello World");
             fail("Should have thrown an exception");
         } catch (ResolveEndpointFailedException e) {
-            assertEquals("Failed to resolve endpoint: ref:xxx due to: No bean could be found
in the registry for: xxx of type: org.apache.camel.Endpoint", e.getMessage());
+            assertEquals("Failed to resolve endpoint: ref://xxx due to: No bean could be
found in the registry for: xxx of type: org.apache.camel.Endpoint", e.getMessage());
             NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.getCause());
             assertEquals("xxx", cause.getName());
         }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java?rev=1326939&r1=1326938&r2=1326939&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
Tue Apr 17 06:13:41 2012
@@ -287,7 +287,7 @@ public class CamelPostProcessorHelperTes
             helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName,
bean, "foo");
             fail("Should throw exception");
         } catch (ResolveEndpointFailedException e) {
-            assertEquals("Failed to resolve endpoint: xxx:foo due to: No component found
with scheme: xxx", e.getMessage());
+            assertEquals("Failed to resolve endpoint: xxx://foo due to: No component found
with scheme: xxx", e.getMessage());
         }
     }
 



Mime
View raw message