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 2011/06/06 11:43:04 UTC
svn commit: r1132562 - in /camel/trunk:
camel-core/src/test/java/org/apache/camel/issues/
components/camel-spring/src/test/java/org/apache/camel/spring/issues/
components/camel-spring/src/test/resources/org/apache/camel/spring/issues/
Author: davsclaus
Date: Mon Jun 6 09:43:03 2011
New Revision: 1132562
URL: http://svn.apache.org/viewvc?rev=1132562&view=rev
Log:
CAMEL-4022: Added unit tests.
Added:
camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTwoRoutesTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml
- copied, changed from r1132530, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringCatchNestedFailTest.xml
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,64 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.ErrorHandlerBuilderRef;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ *
+ */
+public class OnExceptionErrorHandlerRefIssueTest extends ContextTestSupport {
+
+ public void testOnExceptionErrorHandlerRef() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:handled").expectedMessageCount(1);
+ getMockEndpoint("mock:dead").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
+ return jndi;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ errorHandler(new ErrorHandlerBuilderRef("myDLC"));
+
+ from("direct:start")
+ .onException(IllegalArgumentException.class)
+ .handled(true)
+ .to("mock:handled")
+ .end()
+ .to("mock:a")
+ .throwException(new IllegalArgumentException("Damn"));
+ }
+ };
+ }
+}
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTwoRoutesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTwoRoutesTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTwoRoutesTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionErrorHandlerRefIssueTwoRoutesTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,78 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.ErrorHandlerBuilderRef;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ *
+ */
+public class OnExceptionErrorHandlerRefIssueTwoRoutesTest extends ContextTestSupport {
+
+ public void testOnExceptionErrorHandlerRef() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:handled").expectedMessageCount(1);
+ getMockEndpoint("mock:dead").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testOnExceptionErrorHandlerRefFoo() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(0);
+ getMockEndpoint("mock:handled").expectedMessageCount(0);
+ getMockEndpoint("mock:dead").expectedMessageCount(1);
+
+ template.sendBody("direct:foo", "Hello Foo");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
+ return jndi;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ errorHandler(new ErrorHandlerBuilderRef("myDLC"));
+
+ from("direct:foo")
+ .to("mock:foo")
+ .throwException(new IllegalArgumentException("Damn Foo"));
+
+ from("direct:start")
+ .onException(IllegalArgumentException.class)
+ .handled(true)
+ .to("mock:handled")
+ .end()
+ .to("mock:a")
+ .throwException(new IllegalArgumentException("Damn"));
+ }
+ };
+ }
+}
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,63 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.ErrorHandlerBuilderRef;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ *
+ */
+public class OnExceptionRouteScopedErrorHandlerRefIssueTest extends ContextTestSupport {
+
+ public void testOnExceptionErrorHandlerRef() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:handled").expectedMessageCount(1);
+ getMockEndpoint("mock:dead").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
+ return jndi;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
+ .onException(IllegalArgumentException.class)
+ .handled(true)
+ .to("mock:handled")
+ .end()
+ .to("mock:a")
+ .throwException(new IllegalArgumentException("Damn"));
+ }
+ };
+ }
+}
Added: camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java (added)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/issues/OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,78 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.ErrorHandlerBuilderRef;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ *
+ */
+public class OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest extends ContextTestSupport {
+
+ public void testOnExceptionErrorHandlerRef() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(1);
+ getMockEndpoint("mock:handled").expectedMessageCount(1);
+ getMockEndpoint("mock:dead").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ public void testOnExceptionErrorHandlerRefFoo() throws Exception {
+ getMockEndpoint("mock:a").expectedMessageCount(0);
+ getMockEndpoint("mock:handled").expectedMessageCount(0);
+ getMockEndpoint("mock:dead").expectedMessageCount(1);
+
+ template.sendBody("direct:foo", "Hello Foo");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
+ return jndi;
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:foo")
+ .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
+ .to("mock:foo")
+ .throwException(new IllegalArgumentException("Damn Foo"));
+
+ from("direct:start")
+ .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
+ .onException(IllegalArgumentException.class)
+ .handled(true)
+ .to("mock:handled")
+ .end()
+ .to("mock:a")
+ .throwException(new IllegalArgumentException("Damn"));
+ }
+ };
+ }
+}
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,33 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.issues.OnExceptionErrorHandlerRefIssueTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ *
+ */
+public class SpringOnExceptionErrorHandlerRefIssueTest extends OnExceptionErrorHandlerRefIssueTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml");
+ }
+
+}
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,33 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.issues.OnExceptionErrorHandlerRefIssueTwoRoutesTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ *
+ */
+public class SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest extends OnExceptionErrorHandlerRefIssueTwoRoutesTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml");
+ }
+
+}
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,33 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.issues.OnExceptionRouteScopedErrorHandlerRefIssueTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ *
+ */
+public class SpringOnExceptionRouteScopedErrorHandlerRefIssueTest extends OnExceptionRouteScopedErrorHandlerRefIssueTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml");
+ }
+
+}
Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.java Mon Jun 6 09:43:03 2011
@@ -0,0 +1,33 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.issues.OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
+/**
+ *
+ */
+public class SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest extends OnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest {
+
+ protected CamelContext createCamelContext() throws Exception {
+ return createSpringCamelContext(this, "org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml");
+ }
+
+}
Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml (from r1132530, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringCatchNestedFailTest.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringCatchNestedFailTest.xml&r1=1132530&r2=1132562&rev=1132562&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringCatchNestedFailTest.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTest.xml Mon Jun 6 09:43:03 2011
@@ -22,37 +22,26 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
- <bean id="myFail" class="java.lang.IllegalArgumentException">
- <constructor-arg index="0" value="Damn"/>
- </bean>
+ <bean id="myFail" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
- <bean id="myFailAgain" class="java.lang.IllegalStateException">
- <constructor-arg index="0" value="Damn Kong"/>
- </bean>
+ <camelContext errorHandlerRef="myDLC" xmlns="http://camel.apache.org/schema/spring">
- <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start"/>
- <doTry>
- <filter>
- <simple>${body} contains 'Donkey'</simple>
- <to uri="mock:donkey"/>
- <throwException ref="myFail"/>
- </filter>
- <to uri="mock:bar"/>
- <doCatch>
- <exception>java.lang.IllegalArgumentException</exception>
- <to uri="mock:catch"/>
- <filter>
- <simple>${body} contains 'Kong'</simple>
- <to uri="mock:kong"/>
- <throwException ref="myFailAgain"/>
- </filter>
- <to uri="mock:catchEnd"/>
- </doCatch>
- </doTry>
- <to uri="mock:end"/>
- </route>
- </camelContext>
+ <errorHandler type="DeadLetterChannel" id="myDLC" deadLetterUri="mock:dead"/>
+
+ <route>
+ <from uri="direct:start"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:handled"/>
+ </onException>
+ <to uri="mock:a"/>
+ <throwException ref="myFail"/>
+ </route>
+ </camelContext>
</beans>
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionErrorHandlerRefIssueTwoRoutesTest.xml Mon Jun 6 09:43:03 2011
@@ -0,0 +1,54 @@
+<?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.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="myFail" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
+
+ <camelContext errorHandlerRef="myDLC" xmlns="http://camel.apache.org/schema/spring">
+
+ <errorHandler type="DeadLetterChannel" id="myDLC" deadLetterUri="mock:dead"/>
+
+ <route>
+ <from uri="direct:foo"/>
+ <to uri="mock:foo"/>
+ <throwException ref="myFail"/>
+ </route>
+
+ <route>
+ <from uri="direct:start"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:handled"/>
+ </onException>
+ <to uri="mock:a"/>
+ <throwException ref="myFail"/>
+ </route>
+
+ </camelContext>
+
+</beans>
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTest.xml Mon Jun 6 09:43:03 2011
@@ -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.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="myFail" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+ <errorHandler type="DeadLetterChannel" id="myDLC" deadLetterUri="mock:dead"/>
+
+ <route errorHandlerRef="myDLC">
+ <from uri="direct:start"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:handled"/>
+ </onException>
+ <to uri="mock:a"/>
+ <throwException ref="myFail"/>
+ </route>
+ </camelContext>
+
+</beans>
Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml?rev=1132562&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/SpringOnExceptionRouteScopedErrorHandlerRefIssueTwoRoutesTest.xml Mon Jun 6 09:43:03 2011
@@ -0,0 +1,54 @@
+<?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.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <bean id="myFail" class="java.lang.IllegalArgumentException">
+ <constructor-arg index="0" value="Damn"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+ <errorHandler type="DeadLetterChannel" id="myDLC" deadLetterUri="mock:dead"/>
+
+ <route errorHandlerRef="myDLC">
+ <from uri="direct:foo"/>
+ <to uri="mock:foo"/>
+ <throwException ref="myFail"/>
+ </route>
+
+ <route errorHandlerRef="myDLC">
+ <from uri="direct:start"/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:handled"/>
+ </onException>
+ <to uri="mock:a"/>
+ <throwException ref="myFail"/>
+ </route>
+
+ </camelContext>
+
+</beans>