You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2014/08/26 15:49:37 UTC
git commit: Remove MyTraceEventHandler class as this is irrelevant
for the test
Repository: camel
Updated Branches:
refs/heads/master b84e7e923 -> 85e35dadc
Remove MyTraceEventHandler class as this is irrelevant for the test
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/85e35dad
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/85e35dad
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/85e35dad
Branch: refs/heads/master
Commit: 85e35dadc8e3990fff6db3ebe8c2c148e5a5df5c
Parents: b84e7e9
Author: Charles Moulliard <ch...@gmail.com>
Authored: Tue Aug 26 15:49:23 2014 +0200
Committer: Charles Moulliard <ch...@gmail.com>
Committed: Tue Aug 26 15:49:23 2014 +0200
----------------------------------------------------------------------
.../osgi/blueprint/BlueprintTracerTest.java | 1 -
.../osgi/blueprint/MyTraceEventHandler.java | 69 --------------------
.../camel/itest/osgi/blueprint/blueprint-29.xml | 7 +-
3 files changed, 2 insertions(+), 75 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/85e35dad/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java
index f372e26..05d0c66 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintTracerTest.java
@@ -73,7 +73,6 @@ public class BlueprintTracerTest extends OSGiBlueprintTestSupport {
.set(Constants.BUNDLE_SYMBOLICNAME, BlueprintTracerTest.class.getName())
.set(Constants.BUNDLE_VERSION, "1.0.0")
.set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .add(MyTraceEventHandler.class)
.build()).noStart(),
// using the features to install the camel components
http://git-wip-us.apache.org/repos/asf/camel/blob/85e35dad/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java
deleted file mode 100644
index fcc7b75..0000000
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyTraceEventHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.apache.camel.itest.osgi.blueprint;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.processor.interceptor.TraceEventHandler;
-import org.apache.camel.processor.interceptor.TraceInterceptor;
-
-import java.util.LinkedList;
-import java.util.List;
-
-public class MyTraceEventHandler implements TraceEventHandler {
-
- private List<StringBuilder> eventMessages;
-
- public MyTraceEventHandler() {
- this.eventMessages = new LinkedList<StringBuilder>();
- }
-
- public static void recordComplete(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("Complete: ");
- message.append(node.getLabel() + ": ");
- message.append(exchange.getIn().getBody());
- }
-
- public static void recordIn(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("In: ");
- message.append(node.getLabel() + ": ");
- message.append(exchange.getIn().getBody());
- }
-
- public static void recordOut(StringBuilder message, ProcessorDefinition<?> node, Exchange exchange) {
- message.append("Out: ");
- message.append(node.getLabel() + ": ");
- if (null != exchange.getOut()) {
- message.append(exchange.getOut().getBody());
- }
- if (null != exchange.getException()) {
- Exception ex = exchange.getException();
- message.append("\t");
- message.append("Ex: ");
- message.append(ex.getMessage());
- }
- }
-
- private synchronized void storeMessage(StringBuilder message) {
- eventMessages.add(message);
- }
-
- public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- StringBuilder message = new StringBuilder();
- recordComplete(message, node, exchange);
- storeMessage(message);
- }
-
- public Object traceExchangeIn(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
- StringBuilder message = new StringBuilder();
- recordIn(message, node, exchange);
- return message;
- }
-
- public void traceExchangeOut(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange, Object traceState) throws Exception {
- if (StringBuilder.class.equals(traceState.getClass())) {
- StringBuilder message = (StringBuilder) traceState;
- recordOut(message, node, exchange);
- storeMessage(message);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/85e35dad/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml
index 7163994..8dea9c8 100644
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml
+++ b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-29.xml
@@ -26,16 +26,13 @@
</route>
</camelContext>
-<!-- <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
+ <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
<property name="traceExceptions" value="false"/>
<property name="traceInterceptors" value="true"/>
<property name="traceExceptions" value="true"/>
<property name="logLevel" value="INFO"/>
<property name="logName" value="org.apache.camel.blueprint.log"/>
<property name="destination" ref="traced"/>
- <property name="traceHandler" ref="myTraceEventHandler"/>
- </bean>-->
-
- <bean id="myTraceEventHandler" class="org.apache.camel.itest.osgi.blueprint.MyTraceEventHandler"/>
+ </bean>
</blueprint>