You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by he...@apache.org on 2015/12/03 12:58:02 UTC

camel git commit: [camel-amqp] Added extra tests.

Repository: camel
Updated Branches:
  refs/heads/master ab5db120e -> 38b12bfb0


[camel-amqp] Added extra tests.


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

Branch: refs/heads/master
Commit: 38b12bfb0da4b7e26c7f1a136ed3ddfd6cd131f6
Parents: ab5db12
Author: Henryk Konsek <he...@gmail.com>
Authored: Thu Dec 3 12:57:57 2015 +0100
Committer: Henryk Konsek <he...@gmail.com>
Committed: Thu Dec 3 12:57:57 2015 +0100

----------------------------------------------------------------------
 .../camel/component/amqp/AMQPRouteTest.java     | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/38b12bfb/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
index ce89bc6..3ed0935 100644
--- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
+++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
@@ -20,6 +20,7 @@ import org.apache.activemq.broker.BrokerService;
 import org.apache.camel.CamelContext;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jms.JmsConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
@@ -75,6 +76,23 @@ public class AMQPRouteTest extends CamelTestSupport {
         resultEndpoint.assertIsSatisfied();
     }
 
+    @Test
+    public void testPrefixWildcard() throws Exception {
+        resultEndpoint.expectedMessageCount(1);
+        template.sendBody("amqp:wildcard.foo.bar", expectedBody);
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Test
+    public void testIncludeDestination() throws Exception {
+        resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.message(0).header("JMSDestination").isEqualTo("ping");
+        template.sendBody("amqp:queue:ping", expectedBody);
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    // Routes fixtures
+
     protected CamelContext createCamelContext() throws Exception {
         CamelContext camelContext = super.createCamelContext();
         camelContext.addComponent("amqp", amqpComponent("amqp://localhost:" + amqpPort));
@@ -98,6 +116,10 @@ public class AMQPRouteTest extends CamelTestSupport {
                 from("amqp:topic:ping")
                         .to("log:routing")
                         .to("mock:result");
+
+                from("amqp:queue:wildcard.>")
+                        .to("log:routing")
+                        .to("mock:result");
             }
         };
     }