You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/01 13:54:21 UTC

[camel] branch master updated (6da583a -> caef79b)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 6da583a  Removed unused imports
     new 4cc88b6  CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring
     new c30bfc1  CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring
     new 71b1f6c  CAMEL-13801 - Fixed CS for Camel-Spring
     new caef79b  Removed unused imports

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 components/camel-spring/pom.xml                    |  5 ++
 .../apache/camel/spring/RegistryInjectionTest.java |  6 +--
 .../camel/spring/SpringMDCTransactedTest.java      | 62 ++++++++++------------
 .../org/apache/camel/spring/RegistryInjection.xml  |  2 +-
 4 files changed, 36 insertions(+), 39 deletions(-)


[camel] 01/04: CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4cc88b6e0fd7eb1ddf2e02488189ac67c2417f17
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 1 15:38:22 2019 +0200

    CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring
---
 components/camel-spring/pom.xml                                |  5 +++++
 .../java/org/apache/camel/spring/RegistryInjectionTest.java    |  5 +++--
 .../java/org/apache/camel/spring/SpringMDCTransactedTest.java  | 10 +++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml
index d0e1a6f..ee2f176 100644
--- a/components/camel-spring/pom.xml
+++ b/components/camel-spring/pom.xml
@@ -107,6 +107,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-management-impl</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
index 95e1bc1..a645792 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -37,8 +38,8 @@ public class RegistryInjectionTest extends SpringTestSupport {
     public void testInjectedStrategy() throws Exception {
         CamelContext context = createCamelContext();
 
-        JndiRegistry jndi = context.getRegistry(JndiRegistry.class);
-        assertNotNull(jndi);
+        Registry reg = context.getRegistry(Registry.class);
+        assertNotNull(reg);
     }
 
 }
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
index 056139a..f357177 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
@@ -22,13 +22,17 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.spi.Registry;
+import org.apache.camel.support.SimpleRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.slf4j.MDC;
 
-public class SpringMDCTransactedTest extends ContextTestSupport {
+public class SpringMDCTransactedTest extends CamelTestSupport {
 
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry result = super.createRegistry();
+	@Override
+    protected Registry createCamelRegistry() throws Exception {
+        Registry result = new SimpleRegistry();
         result.bind("NOOP-TX", new NoopPlatformTransactionManager());
         return result;
     }


[camel] 04/04: Removed unused imports

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit caef79bd14c4d91a220dba4d3e1e1d0dbce6dc5b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 1 15:53:56 2019 +0200

    Removed unused imports
---
 .../src/test/java/org/apache/camel/spring/RegistryInjectionTest.java    | 1 -
 .../src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java  | 2 --
 2 files changed, 3 deletions(-)

diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
index a645792..1ab32fa 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/RegistryInjectionTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.spring;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.spi.Registry;
 import org.junit.Test;
 import org.springframework.context.support.AbstractXmlApplicationContext;
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
index cd82347..5a93b49 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
@@ -16,12 +16,10 @@
  */
 package org.apache.camel.spring;
 
-import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.spi.Registry;
 import org.apache.camel.support.SimpleRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;


[camel] 03/04: CAMEL-13801 - Fixed CS for Camel-Spring

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 71b1f6c27635cdb5150a0c680a7adb3e258d6b63
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 1 15:52:34 2019 +0200

    CAMEL-13801 - Fixed CS for Camel-Spring
---
 .../camel/spring/SpringMDCTransactedTest.java      | 52 +++++++++-------------
 1 file changed, 21 insertions(+), 31 deletions(-)

diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
index f357177..cd82347 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/SpringMDCTransactedTest.java
@@ -30,7 +30,7 @@ import org.slf4j.MDC;
 
 public class SpringMDCTransactedTest extends CamelTestSupport {
 
-	@Override
+    @Override
     protected Registry createCamelRegistry() throws Exception {
         Registry result = new SimpleRegistry();
         result.bind("NOOP-TX", new NoopPlatformTransactionManager());
@@ -55,39 +55,29 @@ public class SpringMDCTransactedTest extends CamelTestSupport {
                 // enable MDC
                 context.setUseMDCLogging(true);
 
-                from("direct:a").routeId("route-a")
-                    .transacted()
-                    .process(new Processor() {
-                        public void process(Exchange exchange) throws Exception {
-                            assertEquals("route-a", MDC.get("camel.routeId"));
-                            assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
-                            assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
-                        }
-                    })
-                    .to("log:foo-before")
-                    .to("direct:b")
-                    .to("log:foo-after")
-                    .process(new Processor() {
-                        public void process(Exchange exchange) throws Exception {
-                            assertEquals("route-a", MDC.get("camel.routeId"));
-                            assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
-                            assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
-                        }
-                    });
+                from("direct:a").routeId("route-a").transacted().process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        assertEquals("route-a", MDC.get("camel.routeId"));
+                        assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
+                        assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
+                    }
+                }).to("log:foo-before").to("direct:b").to("log:foo-after").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        assertEquals("route-a", MDC.get("camel.routeId"));
+                        assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
+                        assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
+                    }
+                });
 
-                from("direct:b").routeId("route-b")
-                    .process(new Processor() {
-                        public void process(Exchange exchange) throws Exception {
-                            assertEquals("route-b", MDC.get("camel.routeId"));
-                            assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
-                            assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
-                        }
-                    })
-                    .to("log:bar")
-                    .to("mock:result");
+                from("direct:b").routeId("route-b").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        assertEquals("route-b", MDC.get("camel.routeId"));
+                        assertEquals(exchange.getExchangeId(), MDC.get("camel.exchangeId"));
+                        assertEquals(exchange.getIn().getMessageId(), MDC.get("camel.messageId"));
+                    }
+                }).to("log:bar").to("mock:result");
             }
         };
     }
 
-
 }


[camel] 02/04: CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c30bfc19ae9e66c2de3f4ba966a087e8a5892ed6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 1 15:49:39 2019 +0200

    CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Spring
---
 .../src/test/resources/org/apache/camel/spring/RegistryInjection.xml    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/RegistryInjection.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/RegistryInjection.xml
index fa0f979..daf7fc0 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/RegistryInjection.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/RegistryInjection.xml
@@ -25,7 +25,7 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
     
-  <bean id="registry" class="org.apache.camel.impl.JndiRegistry"/>
+  <bean id="registry" class="org.apache.camel.support.SimpleRegistry"/>
   
   <camel:camelContext>
     <camel:route>