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 2018/06/09 12:14:46 UTC

[camel] branch master updated (8f25846 -> c6e8208)

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

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


    from 8f25846  Upgrade Libphonenumber and related bundle to version 8.9.7
     new 8228651  Added unit test based on user forum issue
     new c6e8208  Fixed CS

The 2 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:
 .../camel/impl/saga/InMemorySagaCoordinator.java   |  4 +-
 .../apache/camel/processor/saga/SagaProcessor.java |  3 +-
 .../InterceptSendToEndpointMultipleRoutesTest.java | 90 ++++++++++++++++++++++
 3 files changed, 95 insertions(+), 2 deletions(-)
 create mode 100644 camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointMultipleRoutesTest.java

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 02/02: Fixed CS

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

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

commit c6e82083ea76aec3fac42133394ac71335ad0659
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jun 9 14:14:10 2018 +0200

    Fixed CS
---
 .../main/java/org/apache/camel/impl/saga/InMemorySagaCoordinator.java | 4 +++-
 .../src/main/java/org/apache/camel/processor/saga/SagaProcessor.java  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/impl/saga/InMemorySagaCoordinator.java b/camel-core/src/main/java/org/apache/camel/impl/saga/InMemorySagaCoordinator.java
index 1d3f44e..1cb8ac4 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/saga/InMemorySagaCoordinator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/saga/InMemorySagaCoordinator.java
@@ -87,7 +87,9 @@ public class InMemorySagaCoordinator implements CamelSagaCoordinator {
                 try {
                     values.put(option, expression.evaluate(exchange, Object.class));
                 } catch (Exception ex) {
-                    return CompletableFuture.supplyAsync(() -> {throw new RuntimeCamelException("Cannot evaluate saga option '" + option + "'", ex);});
+                    return CompletableFuture.supplyAsync(() -> {
+                        throw new RuntimeCamelException("Cannot evaluate saga option '" + option + "'", ex);
+                    });
                 }
             }
         }
diff --git a/camel-core/src/main/java/org/apache/camel/processor/saga/SagaProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/saga/SagaProcessor.java
index 95b94f2..a3a6d50 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/saga/SagaProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/saga/SagaProcessor.java
@@ -101,7 +101,8 @@ public abstract class SagaProcessor extends DelegateAsyncProcessor {
         ifNotException(ex, exchange, false, null, null, callback, code);
     }
 
-    protected void ifNotException(Throwable ex, Exchange exchange, boolean handleCompletion, CamelSagaCoordinator coordinator, CamelSagaCoordinator previousCoordinator, AsyncCallback callback, Runnable code) {
+    protected void ifNotException(Throwable ex, Exchange exchange, boolean handleCompletion, CamelSagaCoordinator coordinator,
+                                  CamelSagaCoordinator previousCoordinator, AsyncCallback callback, Runnable code) {
         if (ex != null) {
             exchange.setException(ex);
             if (handleCompletion) {

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.

[camel] 01/02: Added unit test based on user forum issue

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

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

commit 82286514db9404418b078319fde1af32e0bc0ebb
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jun 9 14:12:17 2018 +0200

    Added unit test based on user forum issue
---
 .../InterceptSendToEndpointMultipleRoutesTest.java | 90 ++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointMultipleRoutesTest.java b/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointMultipleRoutesTest.java
new file mode 100644
index 0000000..d944e565
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptSendToEndpointMultipleRoutesTest.java
@@ -0,0 +1,90 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor.intercept;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * Unit test for intercepting sending to endpoint with multiple routes
+ */
+public class InterceptSendToEndpointMultipleRoutesTest extends ContextTestSupport {
+
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
+    }
+
+    public void testInterceptEndpoint() throws Exception {
+        // NOTE: each of these routes must extend our base route class
+
+        context.addRoutes(new MyBaseRoute() {
+            @Override
+            public void configure() throws Exception {
+                super.configure();
+
+                from("direct:a")
+                    .to("seda:a")
+                    .to("mock:result");
+            }
+        });
+        context.addRoutes(new MyBaseRoute() {
+            @Override
+            public void configure() throws Exception {
+                super.configure();
+
+                from("direct:b")
+                    .to("seda:b")
+                    .to("mock:result");
+            }
+        });
+        context.addRoutes(new MyBaseRoute() {
+            @Override
+            public void configure() throws Exception {
+                super.configure();
+
+                from("direct:c")
+                    .to("seda:c")
+                    .to("mock:c")
+                    .to("mock:result");
+            }
+        });
+
+        context.start();
+
+        getMockEndpoint("mock:result").expectedBodiesReceived("A", "B", "C");
+        getMockEndpoint("mock:detour").expectedBodiesReceived("A", "B", "C");
+        getMockEndpoint("mock:c").expectedBodiesReceived("C");
+
+        template.sendBody("direct:a", "A");
+        template.sendBody("direct:b", "B");
+        template.sendBody("direct:c", "C");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    private abstract class MyBaseRoute extends RouteBuilder {
+        @Override
+        public void configure() throws Exception {
+            // base route with common interceptors
+
+            interceptSendToEndpoint("seda:*").skipSendToOriginalEndpoint()
+                .to("mock:detour");
+        }
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.