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 <davscl...@apache.org>
Authored: Sat Feb 20 09:10:24 2016 +0100
Committer: Claus Ibsen <davscl...@apache.org>
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");
             }
         };

Reply via email to