You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/08/07 16:49:12 UTC

[camel] branch camel-3.x updated (6f82708a0c0 -> 78055afd0ef)

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

orpiske pushed a change to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git


    from 6f82708a0c0 CAMEL-19498: camel-core - Pool for non-singleton polling consumer should be limite to capacity size, to avoid growing unlimited and leak memory. (#11013)
     new 134cc113d43 CAMEL-19685: increase logging in camel-mock
     new 78055afd0ef (chores) camel-mock: avoid costly boxing/unboxing operations for integer operations (#11020)

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:
 .../apache/camel/component/mock/MockEndpoint.java  | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)


[camel] 02/02: (chores) camel-mock: avoid costly boxing/unboxing operations for integer operations (#11020)

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

orpiske pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 78055afd0efeea6fe7e45db3f75ef3969605a643
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Mon Aug 7 12:05:14 2023 +0200

    (chores) camel-mock: avoid costly boxing/unboxing operations for integer operations (#11020)
---
 .../main/java/org/apache/camel/component/mock/MockEndpoint.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 353b8fc08cf..1191772a1aa 100644
--- a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -1812,6 +1812,14 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
         }
     }
 
+    protected void assertEquals(String message, int expectedValue, int actualValue) {
+        if (expectedValue != actualValue) {
+            logReceivedExchanges();
+
+            fail(message + ". Expected: <" + expectedValue + "> but was: <" + actualValue + ">");
+        }
+    }
+
     protected void assertEquals(String message, Object expectedValue, Object actualValue) {
         if (!ObjectHelper.equal(expectedValue, actualValue)) {
             logReceivedExchanges();


[camel] 01/02: CAMEL-19685: increase logging in camel-mock

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

orpiske pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 134cc113d43da184477a140467d90649225e6ae9
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Aug 1 11:21:50 2023 +0200

    CAMEL-19685: increase logging in camel-mock
---
 .../org/apache/camel/component/mock/MockEndpoint.java   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 383f01db318..353b8fc08cf 100644
--- a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -1814,10 +1814,27 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint,
 
     protected void assertEquals(String message, Object expectedValue, Object actualValue) {
         if (!ObjectHelper.equal(expectedValue, actualValue)) {
+            logReceivedExchanges();
+
             fail(message + ". Expected: <" + expectedValue + "> but was: <" + actualValue + ">");
         }
     }
 
+    private void logReceivedExchanges() {
+        for (Exchange exchange : receivedExchanges) {
+            LOG.warn("Received exchange: {}", exchange);
+            final Message exchangeMessage = exchange.getMessage();
+            if (exchangeMessage != null) {
+                LOG.warn("Received exchange message: {}", exchangeMessage);
+                final Object body = exchangeMessage.getBody();
+                if (body != null) {
+                    LOG.warn("Received exchange message body: {}", body);
+                    LOG.warn("Received exchange message body type: {}", body.getClass());
+                }
+            }
+        }
+    }
+
     /**
      * Asserts that the given {@code predicate} is {@code true}, if not an {@code AssertionError} is raised with the
      * give message.