You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/07/14 17:54:47 UTC
camel git commit: CAMEL-8960: Added unit test
Repository: camel
Updated Branches:
refs/heads/master f92a96c87 -> 2205b4a6a
CAMEL-8960: 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/2205b4a6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2205b4a6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2205b4a6
Branch: refs/heads/master
Commit: 2205b4a6aa1a3543dcf6479bd9e7fb99dfe2f156
Parents: f92a96c
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Jul 14 17:44:52 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Jul 14 18:01:26 2015 +0200
----------------------------------------------------------------------
.../RouteStartupOrderDirectReverseTest.java | 60 ++++++++++++++++++++
1 file changed, 60 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2205b4a6/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderDirectReverseTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderDirectReverseTest.java b/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderDirectReverseTest.java
new file mode 100644
index 0000000..240730e
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderDirectReverseTest.java
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.processor;
+
+import java.util.List;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spi.RouteStartupOrder;
+
+/**
+ * @version
+ */
+public class RouteStartupOrderDirectReverseTest extends ContextTestSupport {
+
+ public void testRouteStartupOrder() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+
+ template.sendBody("direct:bar", "Hello World");
+
+ assertMockEndpointsSatisfied();
+
+ // assert correct order
+ DefaultCamelContext dcc = (DefaultCamelContext) context;
+ List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
+
+ assertEquals(2, order.size());
+ assertEquals("direct://bar", order.get(1).getRoute().getEndpoint().getEndpointUri());
+ assertEquals("direct://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:foo").startupOrder(1).routeId("foo").to("mock:result");
+
+ from("direct:bar").startupOrder(2).routeId("bar").to("direct:foo");
+ }
+ };
+ }
+}
\ No newline at end of file