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 2023/01/10 10:39:47 UTC

[camel] branch main created (now 833c4340af7)

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

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


      at 833c4340af7 (chores) camel-caffeine: use a more strict assert for equality check in the load producer test

This branch includes the following new commits:

     new 7b752c8e6d1 (chores) camel-ftp: prevent disconnect from suppressing exception
     new 833c4340af7 (chores) camel-caffeine: use a more strict assert for equality check in the load producer test

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.



[camel] 02/02: (chores) camel-caffeine: use a more strict assert for equality check in the load producer test

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

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

commit 833c4340af75a02f9ce057253ed34c71d98b0325
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 10 09:31:29 2023 +0100

    (chores) camel-caffeine: use a more strict assert for equality check in the load producer test
---
 .../component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
index 3a052246656..806c3bf495c 100644
--- a/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
+++ b/components/camel-caffeine/src/test/java/org/apache/camel/component/caffeine/loadcache/CaffeineLoadCacheProducerTest.java
@@ -32,6 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport {
@@ -94,7 +95,7 @@ public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport
         final Map<String, String> elements = getTestCache().getAllPresent(keys);
         keys.forEach(k -> {
             assertTrue(elements.containsKey(k));
-            assertEquals(map.get(k), elements.get(k));
+            assertSame(map.get(k), elements.get(k));
         });
 
         MockEndpoint.assertIsSatisfied(context);
@@ -145,7 +146,7 @@ public class CaffeineLoadCacheProducerTest extends CaffeineLoadCacheTestSupport
         final Map<String, String> elements = mock.getExchanges().get(0).getIn().getBody(Map.class);
         keys.forEach(k -> {
             assertTrue(elements.containsKey(k));
-            assertEquals(map.get(k), elements.get(k));
+            assertSame(map.get(k), elements.get(k));
         });
     }
 


[camel] 01/02: (chores) camel-ftp: prevent disconnect from suppressing exception

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

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

commit 7b752c8e6d16ccd5a22ffaf7c9c7d2e24b20c7ce
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Jan 10 10:11:41 2023 +0100

    (chores) camel-ftp: prevent disconnect from suppressing exception
---
 .../apache/camel/component/file/remote/FtpOperations.java  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
index e29ba3e1aae..c4d3d5df486 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
@@ -302,17 +302,21 @@ public class FtpOperations implements RemoteFileOperations<FTPFile> {
         try {
             log.trace("Client logout");
             client.logout();
+            client.disconnect();
         } catch (IOException e) {
-            throw new GenericFileOperationFailedException(client.getReplyCode(), client.getReplyString(), e.getMessage(), e);
-        } finally {
+            GenericFileOperationFailedException gfo = new GenericFileOperationFailedException(
+                    client.getReplyCode(), client.getReplyString(), e.getMessage(), e);
             try {
                 log.trace("Client disconnect");
                 client.disconnect();
-            } catch (IOException e) {
-                throw new GenericFileOperationFailedException(
-                        client.getReplyCode(), client.getReplyString(), e.getMessage(), e);
+            } catch (IOException ed) {
+                log.warn("Failed to disconnect: {}", e.getMessage(), e);
+                gfo.addSuppressed(ed);
             }
+
+            throw gfo;
         }
+
         clientActivityListener.onDisconnected(endpoint.getConfiguration().remoteServerInformation());
     }