Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED15918A92 for ; Sat, 20 Feb 2016 09:15:04 +0000 (UTC) Received: (qmail 4361 invoked by uid 500); 20 Feb 2016 09:15:04 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 4311 invoked by uid 500); 20 Feb 2016 09:15:04 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 4302 invoked by uid 99); 20 Feb 2016 09:15:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Feb 2016 09:15:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B8F75E0104; Sat, 20 Feb 2016 09:15:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sat, 20 Feb 2016 09:15:04 -0000 Message-Id: <027993b5dbfe41099d283714d3b4d40d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] camel git commit: CAMEL-9566: Added unit test Repository: camel Updated Branches: refs/heads/master e3cfbeed6 -> 80b0d0b44 CAMEL-9566: Added unit test Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd3251cb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd3251cb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd3251cb Branch: refs/heads/master Commit: bd3251cbc410d5130a696bc3a6a1464590c80b19 Parents: e3cfbee Author: Claus Ibsen Authored: Sat Feb 20 09:10:24 2016 +0100 Committer: Claus Ibsen Committed: Sat Feb 20 09:10:24 2016 +0100 ---------------------------------------------------------------------- .../ahc/ws/WsProducerConsumerTest.java | 28 +++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bd3251cb/components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java b/components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java index 54d8b09..cf7403d 100644 --- a/components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java +++ b/components/camel-ahc-ws/src/test/java/org/apache/camel/component/ahc/ws/WsProducerConsumerTest.java @@ -87,19 +87,41 @@ public class WsProducerConsumerTest extends CamelTestSupport { mock.assertIsSatisfied(); } - + @Test + public void testTwoRoutesRestart() throws Exception { + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedBodiesReceived(TEST_MESSAGE); + + template.sendBody("direct:input", TEST_MESSAGE); + + mock.assertIsSatisfied(); + + resetMocks(); + + log.info("Restarting bar route"); + context.stopRoute("bar"); + Thread.sleep(500); + context.startRoute("bar"); + + mock.expectedBodiesReceived(TEST_MESSAGE); + + template.sendBody("direct:input", TEST_MESSAGE); + + mock.assertIsSatisfied(); + } + @Override protected RouteBuilder[] createRouteBuilders() throws Exception { RouteBuilder[] rbs = new RouteBuilder[2]; rbs[0] = new RouteBuilder() { public void configure() { - from("direct:input") + from("direct:input").routeId("foo") .to("ahc-ws://localhost:" + PORT); } }; rbs[1] = new RouteBuilder() { public void configure() { - from("ahc-ws://localhost:" + PORT) + from("ahc-ws://localhost:" + PORT).routeId("bar") .to("mock:result"); } };