You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/20 07:51:57 UTC

[1/3] camel git commit: camel-cdi - Should not toString instance as its likely proxied in CDI and can cause to mask the real exception.

Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x f81f7d8d4 -> fd534e777
  refs/heads/master 26368f7ab -> b7bede86a


camel-cdi - Should not toString instance as its likely proxied in CDI and can cause to mask the real exception.


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

Branch: refs/heads/camel-2.16.x
Commit: 5fcb49733828e64f6aa1ccbe91e00165ec1a9cee
Parents: f81f7d8
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Nov 19 15:19:39 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Nov 19 15:21:11 2015 +0100

----------------------------------------------------------------------
 .../apache/camel/cdi/internal/CamelContextConfig.java    | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5fcb4973/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
----------------------------------------------------------------------
diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
index 523d41d..65c92ac 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/internal/CamelContextConfig.java
@@ -63,8 +63,9 @@ public class CamelContextConfig {
                 }
             }
             Object reference = beanManager.getReference(bean, beanClass, createContext);
-            ObjectHelper.notNull(reference, "Could not instantiate bean of type " + beanClass.getName() + " for " + bean);
+            ObjectHelper.notNull(reference, "Could not instantiate bean of type: " + beanClass.getName() + " for " + bean);
             try {
+                // we should not toString reference instance as in CDI it may be proxied
                 if (reference instanceof RoutesBuilder) {
                     RoutesBuilder routeBuilder = (RoutesBuilder)reference;
                     camelContext.addRoutes(routeBuilder);
@@ -72,14 +73,12 @@ public class CamelContextConfig {
                     RouteContainer routeContainer = (RouteContainer)reference;
                     camelContext.addRouteDefinitions(routeContainer.getRoutes());
                 } else {
-                    throw new IllegalArgumentException("Invalid route builder " + reference
-                            + " of type " + beanClass.getName()
+                    throw new IllegalArgumentException("Invalid route builder of type: " + beanClass.getName()
                             + ". Should be RoutesBuilder or RoutesContainer");
                 }
             } catch (Exception e) {
-                throw new RuntimeCamelException(
-                        "Could not add " + reference + " to CamelContext: " + camelContext + ". Reason: " + e,
-                        e);
+                throw new RuntimeCamelException("Error adding route builder of type: " + beanClass.getName()
+                        + " to CamelContext: " + camelContext.getName() + " due " + e.getMessage(), e);
             }
         }
     }


[3/3] camel git commit: Fixed test

Posted by da...@apache.org.
Fixed test


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

Branch: refs/heads/camel-2.16.x
Commit: fd534e777b1724632be86ca7246bb76fa2574efd
Parents: 5fcb497
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 20 07:51:04 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 20 07:51:29 2015 +0100

----------------------------------------------------------------------
 .../util/toolbox/XsltAggregationStrategyTest.java     | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fd534e77/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
index 7ad2ab6..d0e3c5e 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
@@ -24,26 +24,30 @@ import org.junit.Test;
 /**
  * Unit test for the {@link XsltAggregationStrategy}.
  * <p>
- * Need to use Saxon to get a predictable result: we cannot rely on the JDK's XSLT processor as it can vary across
+ * Need to use Saxon to get a predictable result: We cannot rely on the JDK's XSLT processor as it can vary across
  * platforms and JDK versions. Also, Xalan does not handle node-set properties well.
  */
 public class XsltAggregationStrategyTest extends CamelTestSupport {
 
     @Test
     public void testXsltAggregationDefaultProperty() throws Exception {
-        context.startRoute("route1");
         MockEndpoint mock = getMockEndpoint("mock:transformed");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+
+        context.startRoute("route1");
+
         assertMockEndpointsSatisfied();
     }
 
     @Test
     public void testXsltAggregationUserProperty() throws Exception {
-        context.startRoute("route2");
         MockEndpoint mock = getMockEndpoint("mock:transformed");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+
+        context.startRoute("route2");
+
         assertMockEndpointsSatisfied();
     }
 
@@ -51,7 +55,7 @@ public class XsltAggregationStrategyTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&sortBy=file:name&antInclude=*.xml")
                         .routeId("route1").noAutoStartup()
                         .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate.xsl")
                                 .withSaxon())
@@ -60,7 +64,7 @@ public class XsltAggregationStrategyTest extends CamelTestSupport {
                         .log("after aggregate body: ${body}")
                         .to("mock:transformed");
 
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&sortBy=file:name&antInclude=*.xml")
                         .routeId("route2").noAutoStartup()
                         .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate-user-property.xsl")
                                 .withSaxon().withPropertyName("user-property"))


[2/3] camel git commit: Fixed test

Posted by da...@apache.org.
Fixed test


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

Branch: refs/heads/master
Commit: b7bede86a4e1b962caaa7c3ab7fd4b479005e4d5
Parents: 26368f7
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 20 07:51:04 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 20 07:51:04 2015 +0100

----------------------------------------------------------------------
 .../util/toolbox/XsltAggregationStrategyTest.java     | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b7bede86/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
index 7ad2ab6..d0e3c5e 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
@@ -24,26 +24,30 @@ import org.junit.Test;
 /**
  * Unit test for the {@link XsltAggregationStrategy}.
  * <p>
- * Need to use Saxon to get a predictable result: we cannot rely on the JDK's XSLT processor as it can vary across
+ * Need to use Saxon to get a predictable result: We cannot rely on the JDK's XSLT processor as it can vary across
  * platforms and JDK versions. Also, Xalan does not handle node-set properties well.
  */
 public class XsltAggregationStrategyTest extends CamelTestSupport {
 
     @Test
     public void testXsltAggregationDefaultProperty() throws Exception {
-        context.startRoute("route1");
         MockEndpoint mock = getMockEndpoint("mock:transformed");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+
+        context.startRoute("route1");
+
         assertMockEndpointsSatisfied();
     }
 
     @Test
     public void testXsltAggregationUserProperty() throws Exception {
-        context.startRoute("route2");
         MockEndpoint mock = getMockEndpoint("mock:transformed");
         mock.expectedMessageCount(1);
         mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+
+        context.startRoute("route2");
+
         assertMockEndpointsSatisfied();
     }
 
@@ -51,7 +55,7 @@ public class XsltAggregationStrategyTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&sortBy=file:name&antInclude=*.xml")
                         .routeId("route1").noAutoStartup()
                         .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate.xsl")
                                 .withSaxon())
@@ -60,7 +64,7 @@ public class XsltAggregationStrategyTest extends CamelTestSupport {
                         .log("after aggregate body: ${body}")
                         .to("mock:transformed");
 
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&sortBy=file:name&antInclude=*.xml")
                         .routeId("route2").noAutoStartup()
                         .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate-user-property.xsl")
                                 .withSaxon().withPropertyName("user-property"))