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:58 UTC

[camel] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 8881f7f  CAMEL-13236: mock endpoint - Small glitch in logging excepted failure
8881f7f is described below

commit 8881f7f7e844e18d47346a22be93d2d06fd57773
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Feb 21 12:41:02 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/core/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/core/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 46392c9..7984e80 100644
--- a/core/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/core/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -429,7 +429,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. 
@@ -450,7 +455,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.