camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-11452: Added to unit test. Thanks to Jose Luis Pedrosa for the patch.
Date Tue, 12 Sep 2017 14:07:34 GMT
Repository: camel
Updated Branches:
  refs/heads/master c679ed1f1 -> 98e38a976


CAMEL-11452: Added to unit test. Thanks to Jose Luis Pedrosa for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/98e38a97
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/98e38a97
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/98e38a97

Branch: refs/heads/master
Commit: 98e38a976c3a600b267839e68c3f28bed3f29ee6
Parents: c679ed1
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Sep 12 16:07:26 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Sep 12 16:07:26 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/stomp/StompProducerTest.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/98e38a97/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
index c1e09dc..a564237 100644
--- a/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
+++ b/components/camel-stomp/src/test/java/org/apache/camel/component/stomp/StompProducerTest.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.Exchange;
 import org.apache.camel.Producer;
 import org.apache.camel.builder.RouteBuilder;
+import org.fusesource.hawtbuf.AsciiBuffer;
 import org.fusesource.stomp.client.BlockingConnection;
 import org.fusesource.stomp.client.Stomp;
 import org.fusesource.stomp.codec.StompFrame;
@@ -33,6 +34,9 @@ import static org.fusesource.stomp.client.Constants.SUBSCRIBE;
 
 public class StompProducerTest extends StompBaseTest {
 
+    private static final String HEADER = "testheader1";
+    private static final String HEADER_VALUE = "testheader1";
+
     @Test
     public void testProduce() throws Exception {
         if (!canTest()) {
@@ -58,6 +62,8 @@ public class StompProducerTest extends StompBaseTest {
                     try {
                         StompFrame frame = subscribeConnection.receive();
                         frame.contentAsString().startsWith("test message ");
+                        assertTrue(frame.contentAsString().startsWith("test message "));
+                        assertTrue(frame.getHeader(new AsciiBuffer(HEADER)).ascii().toString().startsWith(HEADER_VALUE));
                         latch.countDown();
                     } catch (Exception e) {
                         e.printStackTrace();
@@ -72,6 +78,7 @@ public class StompProducerTest extends StompBaseTest {
         for (int i = 0; i < numberOfMessages; i++) {
             Exchange exchange = producer.createExchange();
             exchange.getIn().setBody(("test message " + i).getBytes("UTF-8"));
+            exchange.getIn().setHeader(HEADER, HEADER_VALUE);
             producer.process(exchange);
         }
         latch.await(20, TimeUnit.SECONDS);


Mime
View raw message