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 2019/02/21 11:51:59 UTC

[camel] branch camel-2.x updated: CAMEL-13236: mock endpoint - Small glitch in logging excepted failure

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

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


The following commit(s) were added to refs/heads/camel-2.x by this push:
     new 4517f19  CAMEL-13236: mock endpoint - Small glitch in logging excepted failure
4517f19 is described below

commit 4517f199b40d3671e04b50e2db52379274b015f2
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 21 12:50:36 2019 +0100

    CAMEL-13236: mock endpoint - Small glitch in logging excepted failure
---
 .../java/org/apache/camel/component/mock/MockEndpoint.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 54b4934..67b8edb 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -434,7 +434,12 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
             // did not throw expected error... fail!
             failed = true;
         } catch (AssertionError e) {
-            LOG.info("Caught expected failure: {}", e);
+            if (LOG.isDebugEnabled()) {
+                // log incl stacktrace
+                LOG.debug("Caught expected failure: " + e.getMessage(), e);
+            } else {
+                LOG.info("Caught expected failure: " + e.getMessage());
+            }
         }
         if (failed) {
             // fail() throws the AssertionError to indicate the test failed. 
@@ -455,7 +460,12 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
             // did not throw expected error... fail!
             failed = true;
         } catch (AssertionError e) {
-            LOG.info("Caught expected failure: {}", e);
+            if (LOG.isDebugEnabled()) {
+                // log incl stacktrace
+                LOG.debug("Caught expected failure: " + e.getMessage(), e);
+            } else {
+                LOG.info("Caught expected failure: " + e.getMessage());
+            }
         }
         if (failed) { 
             // fail() throws the AssertionError to indicate the test failed.