camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-11410: camel-spring - Should not list uris as spring bean ids from Camel routes
Date Wed, 14 Jun 2017 17:26:32 GMT
Repository: camel
Updated Branches:
  refs/heads/master 70d4e52ce -> 891148417


CAMEL-11410: camel-spring - Should not list uris as spring bean ids from Camel routes


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/78fea48d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/78fea48d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/78fea48d

Branch: refs/heads/master
Commit: 78fea48d0fe350fae4fecc9d4b5f690e3026754b
Parents: 70d4e52
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jun 14 15:25:09 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jun 14 15:25:16 2017 +0200

----------------------------------------------------------------------
 .../spring/handler/CamelNamespaceHandler.java   |  3 +-
 .../spring/CircularComponentInjectionTest.java  |  3 +-
 .../camel/spring/NodeIdReferenceTest.java       |  2 +-
 .../CircularComponentInjectionTest-context.xml  |  6 ++--
 .../spring/NodeIdReferenceTest-context.xml      | 15 +++++-----
 ...merTemplateOutOfCamelContextTest-context.xml | 17 ++++++------
 .../SpringConsumerTemplateTest-context.xml      | 29 ++++++++++----------
 .../SpringJmxEndpointInjectBeanRefTest.xml      |  4 ++-
 8 files changed, 44 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
index 2b89d44..43afb2b 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
@@ -440,7 +440,7 @@ public class CamelNamespaceHandler extends NamespaceHandlerSupport {
             }
 
             // register as endpoint defined indirectly in the routes by from/to types having
id explicit set
-            registerEndpointsWithIdsDefinedInFromOrToTypes(element, parserContext, contextId,
binder);
+            // registerEndpointsWithIdsDefinedInFromOrToTypes(element, parserContext, contextId,
binder);
 
             // register templates if not already defined
             registerTemplates(element, parserContext, contextId);
@@ -534,6 +534,7 @@ public class CamelNamespaceHandler extends NamespaceHandlerSupport {
     /**
      * Used for auto registering endpoints from the <tt>from</tt> or <tt>to</tt>
DSL if they have an id attribute set
      */
+    @Deprecated
     protected void registerEndpointsWithIdsDefinedInFromOrToTypes(Element element, ParserContext
parserContext, String contextId, Binder<Node> binder) {
         NodeList list = element.getChildNodes();
         int size = list.getLength();

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentInjectionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentInjectionTest.java
b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentInjectionTest.java
index 92500b7..eea1059 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentInjectionTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentInjectionTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.spring;
 
-
 import org.apache.camel.Endpoint;
 import org.apache.camel.EndpointInject;
 import org.junit.Assert;
@@ -26,8 +25,10 @@ import org.springframework.test.context.ContextConfiguration;
 
 @ContextConfiguration
 public class CircularComponentInjectionTest extends SpringRunWithTestSupport {
+
     @EndpointInject(ref = "seda")
     protected Endpoint sedaEndpoint;
+
     @EndpointInject(ref = "log")
     protected Endpoint logEndpoint;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
b/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
index 0e96717..33613d0 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
@@ -29,7 +29,7 @@ import org.springframework.test.context.ContextConfiguration;
  */
 @ContextConfiguration
 public class NodeIdReferenceTest extends SpringRunWithTestSupport {
-    protected String expectedBody = "Godday World";
+    protected String expectedBody = "Hi World";
 
     @Autowired
     protected ProducerTemplate producer;

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/resources/org/apache/camel/spring/CircularComponentInjectionTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/CircularComponentInjectionTest-context.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/CircularComponentInjectionTest-context.xml
index 4b72c4c..8d7b06e 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/CircularComponentInjectionTest-context.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/CircularComponentInjectionTest-context.xml
@@ -26,9 +26,11 @@
          http://camel.apache.org/schema/spring/camel-spring.xsd">
 
   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+    <endpoint id="log" uri="seda:test"/>
+    <endpoint id="seda" uri="log:test"/>
     <route>
-      <from id="log" uri="seda:test"/>
-      <to id="seda" uri="log:test"/>
+      <from uri="ref:log"/>
+      <to uri="ref:seda"/>
     </route>
   </camelContext>
 

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/resources/org/apache/camel/spring/NodeIdReferenceTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/NodeIdReferenceTest-context.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/NodeIdReferenceTest-context.xml
index 52bae91..27b6434 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/NodeIdReferenceTest-context.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/NodeIdReferenceTest-context.xml
@@ -24,13 +24,14 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <camelContext xmlns="http://camel.apache.org/schema/spring">
-        <template id="camelTemplate"/>
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <template id="camelTemplate"/>
+    <endpoint id="foo" uri="direct:start"/>
 
-        <route>
-            <from id="foo" uri="direct:start"/>
-            <to uri="mock:result"/>
-        </route>
-    </camelContext>
+    <route>
+      <from uri="ref:foo"/>
+      <to uri="mock:result"/>
+    </route>
+  </camelContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateOutOfCamelContextTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateOutOfCamelContextTest-context.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateOutOfCamelContextTest-context.xml
index 5001c78..1e04125 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateOutOfCamelContextTest-context.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateOutOfCamelContextTest-context.xml
@@ -25,14 +25,15 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
-        <route>
-            <from uri="seda:foo"/>
-            <to id="result" uri="mock:result"/>
-        </route>
-    </camelContext>
+  <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
+    <endpoint id="result" uri="mock:result"/>
+    <route>
+      <from uri="seda:foo"/>
+      <to uri="ref:result"/>
+    </route>
+  </camelContext>
 
-    <camel:template id="template" camelContextId="myCamel"/>
-    <camel:consumerTemplate id="consumerTemplate" camelContextId="myCamel"/>
+  <camel:template id="template" camelContextId="myCamel"/>
+  <camel:consumerTemplate id="consumerTemplate" camelContextId="myCamel"/>
 
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml
index a46d834..b4d46e2 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/SpringConsumerTemplateTest-context.xml
@@ -19,24 +19,25 @@
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:camel="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <!-- START SNIPPET: e1 -->
-    <camelContext xmlns="http://camel.apache.org/schema/spring">
-        <!-- define a producer template -->
-        <template id="producer"/>
-        <!-- define a consumer template -->
-        <consumerTemplate id="consumer"/>
-        
-        <route>
-            <from uri="seda:foo"/>
-            <to id="result" uri="mock:result"/>
-        </route>
-    </camelContext>
-    <!-- END SNIPPET: e1 -->
+  <!-- START SNIPPET: e1 -->
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <!-- define a producer template -->
+    <template id="producer"/>
+    <!-- define a consumer template -->
+    <consumerTemplate id="consumer"/>
+    <!-- define endpoint -->
+    <endpoint id="result" uri="mock:result"/>
+
+    <route>
+      <from uri="seda:foo"/>
+      <to uri="ref:result"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: e1 -->
 
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/78fea48d/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringJmxEndpointInjectBeanRefTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringJmxEndpointInjectBeanRefTest.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringJmxEndpointInjectBeanRefTest.xml
index 6914be7..659c8df 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringJmxEndpointInjectBeanRefTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/management/SpringJmxEndpointInjectBeanRefTest.xml
@@ -29,13 +29,15 @@
     <!-- enable JMX -->
     <jmxAgent id="agent" disabled="false"/>
 
+    <endpoint id="foo" uri="seda:foo"/>
+
     <route>
       <from uri="direct:start"/>
       <to uri="bean:myBean"/>
     </route>
 
     <route>
-      <from uri="seda:foo" id="foo"/>
+      <from uri="ref:foo"/>
       <to uri="mock:result"/>
     </route>
 


Mime
View raw message