camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: Fixed test
Date Sat, 09 Apr 2016 12:40:36 GMT
Fixed test


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

Branch: refs/heads/master
Commit: 0267bc898853698e6205aa3ed8b4f88fe4cf26f5
Parents: b649413
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Apr 9 14:34:34 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Apr 9 14:34:34 2016 +0200

----------------------------------------------------------------------
 .../issues/JmsDirectStartupOrderIssueTest.java  | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0267bc89/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsDirectStartupOrderIssueTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsDirectStartupOrderIssueTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsDirectStartupOrderIssueTest.java
index 209664b..4855650 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsDirectStartupOrderIssueTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsDirectStartupOrderIssueTest.java
@@ -20,7 +20,6 @@ import java.util.List;
 import javax.jms.ConnectionFactory;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.ProducerTemplate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.jms.CamelJmsTestHelper;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -37,6 +36,14 @@ public class JmsDirectStartupOrderIssueTest extends CamelTestSupport {
 
     @Test
     public void testJmsDirectStartupOrderIssue() throws Exception {
+        // send messages to queue so there is messages on the queue before we start the route
+        template.sendBody("activemq:queue:foo", "Hello World");
+        template.sendBody("activemq:queue:foo", "Hello Camel");
+        template.sendBody("activemq:queue:foo", "Bye World");
+        template.sendBody("activemq:queue:foo", "Bye Camel");
+
+        context.startRoute("amq");
+
         getMockEndpoint("mock:result").expectedMessageCount(4);
 
         assertMockEndpointsSatisfied();
@@ -56,23 +63,13 @@ public class JmsDirectStartupOrderIssueTest extends CamelTestSupport {
         ConnectionFactory connectionFactory = CamelJmsTestHelper.createPersistentConnectionFactory();
         camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
 
-        ProducerTemplate producer = camelContext.createProducerTemplate();
-
-        // send messages to queue so there is messages on the queue when we start
-        producer.sendBody("activemq:queue:foo", "Hello World");
-        producer.sendBody("activemq:queue:foo", "Hello Camel");
-        producer.sendBody("activemq:queue:foo", "Bye World");
-        producer.sendBody("activemq:queue:foo", "Bye Camel");
-
-        producer.stop();
-
         return camelContext;
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("activemq:queue:foo").routeId("amq").startupOrder(100)
+                from("activemq:queue:foo").routeId("amq").startupOrder(100).autoStartup(false)
                     .to("direct:foo");
 
                 from("direct:foo").routeId("direct").startupOrder(1)


Mime
View raw message