camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r731874 - /activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
Date Tue, 06 Jan 2009 08:21:44 GMT
Author: davsclaus
Date: Tue Jan  6 00:21:43 2009
New Revision: 731874

URL: http://svn.apache.org/viewvc?rev=731874&view=rev
Log:
Added a jms routing slip unit test

Added:
    activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
  (with props)

Added: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java?rev=731874&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
(added)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
Tue Jan  6 00:21:43 2009
@@ -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.component.jms;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
+
+/**
+ * Unit test from JMS -> routing slip
+ */
+public class JmsRoutingSlipTest extends ContextTestSupport {
+
+    protected String componentName = "activemq";
+
+    public void testJmsRoutingSlip() throws Exception {
+        getMockEndpoint("mock:a").expectedBodiesReceived("Hello World");
+        getMockEndpoint("mock:b").expectedBodiesReceived("Hello World");
+
+        template.sendBodyAndHeader("activemq:queue:hello", "Hello World", "myslip", "mock:a#mock:b");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camelContext = super.createCamelContext();
+
+        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        camelContext.addComponent(componentName, jmsComponentClientAcknowledge(connectionFactory));
+
+        return camelContext;
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("activemq:queue:hello").routingSlip("myslip", "#");
+            }
+        };
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRoutingSlipTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message