From a7a75d0851c9c8a6d9fd4c25497e51e8a73ff23a Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Thu, 26 Jun 2008 05:28:36 +0000 Subject: [PATCH] CAMEL-619: Fixed tracer not outputting node ids. Added unit test for tracer. Breadcrum is outputtet to be used for correlation for poor end users looking into the log files git-svn-id: https://svn.apache.org/repos/asf/activemq/camel/trunk@671765 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/camel/processor/DebugInterceptorTest.java | 5 +++++ .../org/apache/camel/processor/TraceInterceptorTest.java | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/camel-core/src/test/java/org/apache/camel/processor/DebugInterceptorTest.java b/camel-core/src/test/java/org/apache/camel/processor/DebugInterceptorTest.java index 3439af71a363d..9765a4e1db54d 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/DebugInterceptorTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/DebugInterceptorTest.java @@ -27,6 +27,7 @@ */ public class DebugInterceptorTest extends ContextTestSupport { + // START SNIPPET: e1 public void testSendingSomeMessages() throws Exception { template.sendBodyAndHeader("direct:start", "Hello London", "to", "James"); template.sendBodyAndHeader("direct:start", "This is Copenhagen calling", "from", "Claus"); @@ -35,6 +36,9 @@ public void testSendingSomeMessages() throws Exception { protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { + // add debugger as an interceptor. The debugger is an enhanced tracer that also + // logs the exchanges at runtime. It is also a framework where we programatically + // can access the internal states of Camel etc. getContext().addInterceptStrategy(new Debugger()); from("direct:start"). @@ -53,5 +57,6 @@ public String toString() { } }; } + // END SNIPPET: e1 } \ No newline at end of file diff --git a/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorTest.java b/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorTest.java index f37194f31dbbb..3830a0cdaf914 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorTest.java @@ -28,6 +28,7 @@ */ public class TraceInterceptorTest extends ContextTestSupport { + // START SNIPPET: e1 public void testSendingSomeMessages() throws Exception { template.sendBodyAndHeader("direct:start", "Hello London", "to", "James"); template.sendBodyAndHeader("direct:start", "This is Copenhagen calling", "from", "Claus"); @@ -36,6 +37,8 @@ public void testSendingSomeMessages() throws Exception { protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { + // add tracer as an interceptor so it will log the exchange executions at runtime + // this can aid us to understand/see how the exchanges is routed etc. getContext().addInterceptStrategy(new Tracer()); from("direct:start"). @@ -54,5 +57,6 @@ public String toString() { } }; } - + // END SNIPPET: e1 + }