Repository: camel Updated Branches: refs/heads/master be5580c8b -> 15a00115b
Added AMQP topic tests. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/15a00115 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/15a00115 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/15a00115 Branch: refs/heads/master Commit: 15a00115b2365a0bde3c1fc96e41d555d553b6ca Parents: be5580c Author: Henryk Konsek <hekon...@gmail.com> Authored: Tue Dec 1 16:37:20 2015 +0100 Committer: Henryk Konsek <hekon...@gmail.com> Committed: Tue Dec 1 16:37:20 2015 +0100 ---------------------------------------------------------------------- .../camel/component/amqp/AMQPRouteTest.java | 30 +++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/15a00115/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 e78e035..e2a6f15 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 @@ -24,23 +24,31 @@ import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Before; import org.junit.Test; -import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; +import static org.apache.camel.component.amqp.AMQPComponent.amqp10Component; public class AMQPRouteTest extends CamelTestSupport { + protected MockEndpoint resultEndpoint; + protected BrokerService broker; - - @Test - public void testJmsRouteWithTextMessage() throws Exception { - String expectedBody = "Hello there!"; - resultEndpoint.reset(); + String expectedBody = "Hello there!"; + + @Test + public void testJmsQueue() throws Exception { resultEndpoint.expectedMessageCount(1); resultEndpoint.message(0).header("cheese").isEqualTo(123); template.sendBodyAndHeader("amqp1-0:queue:ping", expectedBody, "cheese", 123); resultEndpoint.assertIsSatisfied(); } + @Test + public void testJmsTopic() throws Exception { + resultEndpoint.expectedMessageCount(2); + resultEndpoint.message(0).header("cheese").isEqualTo(123); + template.sendBodyAndHeader("amqp1-0:topic:ping", expectedBody, "cheese", 123); + resultEndpoint.assertIsSatisfied(); + } @Before public void setUp() throws Exception { @@ -61,7 +69,7 @@ public class AMQPRouteTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); - camelContext.addComponent("amqp1-0", amqpComponent("amqp://localhost:5672", false)); + camelContext.addComponent("amqp1-0", amqp10Component("amqp://localhost:5672")); return camelContext; } @@ -71,6 +79,14 @@ public class AMQPRouteTest extends CamelTestSupport { from("amqp1-0:queue:ping") .to("log:routing") .to("mock:result"); + + from("amqp1-0:topic:ping") + .to("log:routing") + .to("mock:result"); + + from("amqp1-0:topic:ping") + .to("log:routing") + .to("mock:result"); } }; }