You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2008/03/07 19:05:53 UTC
svn commit: r634766 - in /activemq/camel/trunk:
camel-core/src/test/java/org/apache/camel/processor/
components/camel-spring/src/test/java/org/apache/camel/spring/processor/
components/camel-spring/src/test/resources/org/apache/camel/spring/processor/
Author: jstrachan
Date: Fri Mar 7 10:05:51 2008
New Revision: 634766
URL: http://svn.apache.org/viewvc?rev=634766&view=rev
Log:
applied patch for https://issues.apache.org/activemq/browse/CAMEL-368 with thanks
Added:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java (with props)
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java (with props)
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml (with props)
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListTest.java
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListTest.java?rev=634766&r1=634765&r2=634766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListTest.java Fri Mar 7 10:05:51 2008
@@ -28,7 +28,8 @@
*/
public class RecipientListTest extends ContextTestSupport {
- public void testSendingAMessageUsingMulticastReceivesItsOwnExchange() throws Exception {
+ public void testSendingAMessageUsingMulticastReceivesItsOwnExchange()
+ throws Exception {
MockEndpoint x = getMockEndpoint("mock:x");
MockEndpoint y = getMockEndpoint("mock:y");
MockEndpoint z = getMockEndpoint("mock:z");
@@ -37,16 +38,22 @@
y.expectedBodiesReceived("answer");
z.expectedBodiesReceived("answer");
- template.sendBodyAndHeader("direct:a", "answer", "recipientListHeader", "mock:x,mock:y,mock:z");
+ sendBody();
assertMockEndpointsSatisifed();
}
+ protected void sendBody() {
+ template.sendBodyAndHeader("direct:a", "answer", "recipientListHeader",
+ "mock:x,mock:y,mock:z");
+ }
+
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
// START SNIPPET: example
- from("direct:a").recipientList(header("recipientListHeader").tokenize(","));
+ from("direct:a").recipientList(
+ header("recipientListHeader").tokenize(","));
// END SNIPPET: example
}
};
Added: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java?rev=634766&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java (added)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java Fri Mar 7 10:05:51 2008
@@ -0,0 +1,37 @@
+/**
+ * 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 org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+public class StaticRecipientListTest extends RecipientListTest {
+
+ @Override
+ protected void sendBody() {
+ template.sendBody("direct:a", "answer");
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:a").to("mock:x", "mock:y", "mock:z");
+ }
+ };
+ }
+}
Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java?rev=634766&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java Fri Mar 7 10:05:51 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 static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.processor.StaticRecipientListTest;
+
+public class SpringStaticRecipientListTest extends StaticRecipientListTest {
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/processor/staticRecipientList.xml");
+ }
+}
Propchange: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml?rev=634766&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml (added)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml Fri Mar 7 10:05:51 2008
@@ -0,0 +1,37 @@
+<?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").to("mock:x", "mock:y", "mock:z");
+ -->
+ <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+ <route>
+ <from uri="direct:a"/>
+ <to uri="mock:x"/>
+ <to uri="mock:y"/>
+ <to uri="mock:z"/>
+ </route>
+ </camelContext>
+
+</beans>
Propchange: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/staticRecipientList.xml
------------------------------------------------------------------------------
svn:eol-style = native