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 2008/03/30 12:08:42 UTC

svn commit: r642701 - in /activemq/camel/trunk/components/camel-spring/src/test: java/org/apache/camel/spring/processor/ resources/org/apache/camel/spring/builder/ resources/org/apache/camel/spring/processor/

Author: davsclaus
Date: Sun Mar 30 03:08:41 2008
New Revision: 642701

URL: http://svn.apache.org/viewvc?rev=642701&view=rev
Log:
CAMEL-411: Applied patch from Jonathan with thanks

Added:
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml
Modified:
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml

Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java?rev=642701&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRoutingSlipTest.java Sun Mar 30 03:08:41 2008
@@ -0,0 +1,28 @@
+/**
+ * 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.spring.processor;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.processor.routingslip.RoutingSlipTest;
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+public class SpringRoutingSlipTest extends RoutingSlipTest {
+    protected CamelContext createCamelContext() throws Exception {
+        return createSpringCamelContext(this,
+                "org/apache/camel/spring/processor/routingSlip.xml");
+    }
+}

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml?rev=642701&r1=642700&r2=642701&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml Sun Mar 30 03:08:41 2008
@@ -232,5 +232,17 @@
   </camelContext>
   <!-- END SNIPPET: idempotent -->
 
+  <!--
+     from("direct:c").routingSlip("aRoutingSlipHeader", "#");
+  -->
+  <!-- START SNIPPET: routingslip -->
+  <camelContext id="buildRoutingSlip" xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="direct:c"/>
+      <routingSlip headerName="aRoutingSlipHeader" uriDelimiter="#"/>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: routingslip -->
+
 </beans>
         <!-- END SNIPPET: example -->

Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml?rev=642701&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/routingSlip.xml Sun Mar 30 03:08:41 2008
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+  <!--
+    from("direct:a").routingSlip().to("mock:end");
+    from("direct:b").routingSlip("aRoutingSlipHeader");
+    from("direct:c").routingSlip("aRoutingSlipHeader", "#");
+  -->
+  <camelContext id="camel"
+    xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="direct:a" />
+      <routingSlip />
+      <to uri="mock:end" />
+    </route>
+    <route>
+      <from uri="direct:b" />
+      <routingSlip headerName="aRoutingSlipHeader" />
+    </route>
+    <route>
+      <from uri="direct:c" />
+      <routingSlip headerName="aRoutingSlipHeader" uriDelimiter="#" />
+    </route>
+  </camelContext>
+
+</beans>