camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r817330 - in /camel/trunk/components/camel-xmpp/src: main/java/org/apache/camel/component/xmpp/ test/java/org/apache/camel/component/xmpp/
Date Mon, 21 Sep 2009 17:26:19 GMT
Author: janstey
Date: Mon Sep 21 17:26:18 2009
New Revision: 817330

URL: http://svn.apache.org/viewvc?rev=817330&view=rev
Log:
CAMEL-2032 - fix to actually get the string body from the xmppbinding. Thanks to Stan Lewis
for this!


Modified:
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppMessage.java
    camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
    camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppMessage.java?rev=817330&r1=817329&r2=817330&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppMessage.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppMessage.java
Mon Sep 21 17:26:18 2009
@@ -68,7 +68,7 @@
         if (xmppMessage != null) {
             XmppBinding binding = ExchangeHelper.getBinding(getExchange(), XmppBinding.class);
             if (binding != null) {
-                binding.extractBodyFromXmpp(getExchange(), xmppMessage);
+                return binding.extractBodyFromXmpp(getExchange(), xmppMessage);
             }
         }
         return null;

Modified: camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java?rev=817330&r1=817329&r2=817330&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
(original)
+++ camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteChatTest.java
Mon Sep 21 17:26:18 2009
@@ -62,16 +62,6 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
 
-                Processor stringConverter = new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        XmppMessage xmppMessage = (XmppMessage)exchange.getIn();
-                        Message message = xmppMessage.getXmppMessage();
-                        String body = message.getBody();
-                        LOG.debug("Converting message - " + body);
-                        exchange.getIn().setBody(body);
-                    }
-                };
-
                 from("direct:toConsumer")
                     .to(getConsumerUri());
 
@@ -79,11 +69,9 @@
                     .to(getProducerUri());
 
                 from(getConsumerUri())
-                    .process(stringConverter)
                     .to("mock:out1");
 
                 from(getProducerUri())
-                    .process(stringConverter)
                     .to("mock:out2");
             }
         };

Modified: camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java?rev=817330&r1=817329&r2=817330&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
(original)
+++ camel/trunk/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteMultipleProducersSingleConsumerTest.java
Mon Sep 21 17:26:18 2009
@@ -60,16 +60,6 @@
 
                 //getContext().setTracing(true);
 
-                Processor stringConverter = new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        XmppMessage xmppMessage = (XmppMessage)exchange.getIn();
-                        Message message = xmppMessage.getXmppMessage();
-                        String body = message.getBody();
-                        LOG.debug("Converting message - " + body);
-                        exchange.getIn().setBody(body);
-                    }
-                };
-
                 from("direct:toProducer1")
                     .to(getProducer1Uri());
 
@@ -77,15 +67,12 @@
                     .to(getProducer2Uri());
 
                 from(getConsumerUri())
-                    .process(stringConverter)
                     .to(getConsumerUri());
 
                 from(getProducer1Uri())
-                    .process(stringConverter)
                     .to("mock:good");
 
                 from(getProducer2Uri())
-                    .process(stringConverter)
                     .to("mock:bad");
             }
         };



Mime
View raw message