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 2021/01/31 09:04:35 UTC

[camel] branch master updated (af1c532 -> c9036a2)

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 af1c532  Update camel-3-migration-guide.adoc
     new cb2ae5d  CAMEL-16103: Added unit test.
     new c9036a2  Typo

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:
 .../interceptor/TransactedStackSizeTest.java       | 72 ++++++++++++++++++++++
 .../src/test/resources/log4j2.properties           |  1 +
 .../camel/impl/engine/SimpleCamelContext.java      |  2 +-
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeTest.java


[camel] 02/02: Typo

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 c9036a22916622fa443353fd7a27f106ac39bdfc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Jan 31 10:03:52 2021 +0100

    Typo
---
 .../src/main/java/org/apache/camel/impl/engine/SimpleCamelContext.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/SimpleCamelContext.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/SimpleCamelContext.java
index ea696b9..4c0918e 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/SimpleCamelContext.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/SimpleCamelContext.java
@@ -239,7 +239,7 @@ public class SimpleCamelContext extends AbstractCamelContext {
             return result.get();
         } else {
             throw new IllegalArgumentException(
-                    "Cannot find InternalProcessorFactory on classpath. Add ccamel-core-processor to classpath.");
+                    "Cannot find InternalProcessorFactory on classpath. Add camel-core-processor to classpath.");
         }
     }
 


[camel] 01/02: CAMEL-16103: Added unit test.

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 cb2ae5d0447249697352ce46138ed9a99dd4accd
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Jan 31 09:32:02 2021 +0100

    CAMEL-16103: Added unit test.
---
 .../interceptor/TransactedStackSizeTest.java       | 72 ++++++++++++++++++++++
 .../src/test/resources/log4j2.properties           |  1 +
 2 files changed, 73 insertions(+)

diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeTest.java
new file mode 100644
index 0000000..69e0206
--- /dev/null
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/TransactedStackSizeTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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.spring.interceptor;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class TransactedStackSizeTest extends TransactionClientDataSourceSupport {
+
+    private static final boolean PRINT_STACK_TRACE = true;
+
+    @Test
+    public void testStackSize() throws Exception {
+        getMockEndpoint("mock:line").expectedMessageCount(10);
+        getMockEndpoint("mock:result").expectedMessageCount(1);
+
+        template.sendBody("seda:start", "A,B,C,D,E,F,G,H,I,J");
+
+        assertMockEndpointsSatisfied();
+
+        int[] sizes = new int[11];
+        for (int i = 0; i < 10; i++) {
+            int size = getMockEndpoint("mock:line").getReceivedExchanges().get(i).getMessage().getHeader("stackSize",
+                    int.class);
+            sizes[i] = size;
+            log.info("#{} size {}", i, size);
+        }
+        int size = getMockEndpoint("mock:result").getReceivedExchanges().get(0).getMessage().getHeader("stackSize", int.class);
+        sizes[10] = size;
+        log.info("#{} size {}", 10, size);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:start")
+                    .transacted()
+                    .split(body())
+                        .setHeader("stackSize", TransactedStackSizeTest::currentStackSize)
+                        .to("mock:line")
+                    .end()
+                    .setHeader("stackSize", TransactedStackSizeTest::currentStackSize)
+                    .to("mock:result");
+            }
+        };
+    }
+
+    public static int currentStackSize() {
+        int depth = Thread.currentThread().getStackTrace().length;
+        if (PRINT_STACK_TRACE) {
+            new Throwable("Printing Stacktrace depth: " + depth).printStackTrace(System.err);
+        }
+        return depth;
+    }
+
+}
diff --git a/components/camel-spring/src/test/resources/log4j2.properties b/components/camel-spring/src/test/resources/log4j2.properties
index 6e7bfa8..75b6bed 100644
--- a/components/camel-spring/src/test/resources/log4j2.properties
+++ b/components/camel-spring/src/test/resources/log4j2.properties
@@ -26,3 +26,4 @@ appender.out.layout.type = PatternLayout
 appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
 rootLogger.level = INFO
 rootLogger.appenderRef.file.ref = file
+#rootLogger.appenderRef.out.ref = out