Author: ningjiang Date: Wed May 12 11:55:26 2010 New Revision: 943459 URL: http://svn.apache.org/viewvc?rev=943459&view=rev Log: CAMEL-2710 Skip invalid endpoints without throwing an exception
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java (with props) camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml (with props) Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java?rev=943459&view=auto ============================================================================== --- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java (added) +++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java Wed May 12 11:55:26 2010 @@ -0,0 +1,30 @@ +/** + * 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.RandomLoadBalanceTest; +import org.apache.camel.processor.RecipientListIgnoreInvalidEndpointsTest; +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; + +public class SpringRecipientListIgnoreInvalidEndpointsTest extends RecipientListIgnoreInvalidEndpointsTest { + + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, "org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml"); + } + +} \ No newline at end of file Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRecipientListIgnoreInvalidEndpointsTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml?rev=943459&view=auto ============================================================================== --- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml (added) +++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml Wed May 12 11:55:26 2010 @@ -0,0 +1,48 @@ +<?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.5.xsd + http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd + "> + + <!-- + from("direct:a").recipientList(property("myProperty")); + --> + + <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:startA" /> + <recipientList ignoreInvalidEndpoints="true"> + <simple>mock:result,fail:endpoint,direct:a</simple> + </recipientList> + </route> + <route> + <from uri="direct:startB" /> + <recipientList> + <simple>mock:result,fail:endpoint,direct:a</simple> + </recipientList> + </route> + <route> + <from uri="direct:a"/> + <transform><constant>Hello a</constant></transform> + <to uri="mock:endpointA"/> + </route> + </camelContext> + +</beans> Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/recipientListIgnoreInvalidEndpoints.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml