camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r647890 [2/3] - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/component/dataset/ main/java/org/apache/camel/component/file/strategy/ main/java/org/apache/camel/component/log/ main/java/org/apache/camel/converter/stream...
Date Mon, 14 Apr 2008 16:38:43 GMT
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java Mon Apr 14 09:38:25 2008
@@ -1,156 +1,156 @@
-/**
- * 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.builder;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.security.GeneralSecurityException;
-import java.security.KeyException;
-import java.security.KeyManagementException;
-
-import org.apache.camel.CamelExchangeException;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Unit test to test exception configuration
- */
-public class ExceptionBuilderTest extends ContextTestSupport {
-
-    private static final String MESSAGE_INFO = "messageInfo";
-    private static final String ERROR_QUEUE = "mock:error";
-    private static final String BUSINESS_ERROR_QUEUE = "mock:badBusiness";
-    private static final String SECURITY_ERROR_QUEUE = "mock:securityError";
-
-    public void testNPE() throws Exception {
-        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm a NPE");
-
-        template.sendBody("direct:a", "Hello NPE");
-
-        mock.assertIsSatisfied();
-    }
-
-    public void testIOException() throws Exception {
-        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm somekind of IO exception");
-
-        template.sendBody("direct:a", "Hello IO");
-
-        mock.assertIsSatisfied();
-    }
-
-    public void testException() throws Exception {
-        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm just exception");
-
-        template.sendBody("direct:a", "Hello Exception");
-
-        mock.assertIsSatisfied();
-    }
-
-    public void testMyBusinessException() throws Exception {
-        MockEndpoint mock = getMockEndpoint(BUSINESS_ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm my business is not going to well");
-
-        template.sendBody("direct:a", "Hello business");
-
-        mock.assertIsSatisfied();
-    }
-
-    public void testSecurityConfiguredWithTwoExceptions() throws Exception {
-        // test that we also handles a configuration with 2 or more exceptions
-        MockEndpoint mock = getMockEndpoint(SECURITY_ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm some security error");
-
-        template.sendBody("direct:a", "I am not allowed to do this");
-
-        mock.assertIsSatisfied();
-    }
-
-    public static class MyBaseBusinessException extends Exception {
-    }
-
-    public static class MyBusinessException extends MyBaseBusinessException {
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                // START SNIPPET: exceptionBuilder1
-                exception(NullPointerException.class)
-                    .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm a NPE")
-                    .to(ERROR_QUEUE);
-
-                exception(IOException.class)
-                    .initialRedeliveryDelay(5000L)
-                    .maximumRedeliveries(3)
-                    .backOffMultiplier(1.0)
-                    .useExponentialBackOff()
-                    .setHeader(MESSAGE_INFO, "Damm somekind of IO exception")
-                    .to(ERROR_QUEUE);
-
-                exception(Exception.class)
-                    .initialRedeliveryDelay(1000L)
-                    .maximumRedeliveries(2)
-                    .setHeader(MESSAGE_INFO, "Damm just exception")
-                    .to(ERROR_QUEUE);
-                // END SNIPPET: exceptionBuilder1
-
-                exception(MyBaseBusinessException.class)
-                    .initialRedeliveryDelay(1000L)
-                    .maximumRedeliveries(3)
-                    .setHeader(MESSAGE_INFO, "Damm my business is not going to well")
-                    .to(BUSINESS_ERROR_QUEUE);
-
-                exception(GeneralSecurityException.class).exception(KeyException.class)
-                    .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm some security error")
-                    .to(SECURITY_ERROR_QUEUE);
-
-
-                from("direct:a").process(new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        String s = exchange.getIn().getBody(String.class);
-                        if ("Hello NPE".equals(s)) {
-                            throw new NullPointerException();
-                        } else if ("Hello IO".equals(s)) {
-                            throw new ConnectException("Forced for testing - can not connect to remote server");
-                        } else if ("Hello Exception".equals(s)) {
-                            throw new CamelExchangeException("Forced for testing", exchange);
-                        } else if ("Hello business".equals(s)) {
-                            throw new MyBusinessException();
-                        } else if ("I am not allowed to do this".equals(s)) {
-                            throw new KeyManagementException();
-                        }
-                        exchange.getOut().setBody("Hello World");
-                    }
-                }).to("mock:result");
-            }
-        };
-    }
-
-}
-
+/**
+ * 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.builder;
+
+import java.io.IOException;
+import java.net.ConnectException;
+import java.security.GeneralSecurityException;
+import java.security.KeyException;
+import java.security.KeyManagementException;
+
+import org.apache.camel.CamelExchangeException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Unit test to test exception configuration
+ */
+public class ExceptionBuilderTest extends ContextTestSupport {
+
+    private static final String MESSAGE_INFO = "messageInfo";
+    private static final String ERROR_QUEUE = "mock:error";
+    private static final String BUSINESS_ERROR_QUEUE = "mock:badBusiness";
+    private static final String SECURITY_ERROR_QUEUE = "mock:securityError";
+
+    public void testNPE() throws Exception {
+        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm a NPE");
+
+        template.sendBody("direct:a", "Hello NPE");
+
+        mock.assertIsSatisfied();
+    }
+
+    public void testIOException() throws Exception {
+        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm somekind of IO exception");
+
+        template.sendBody("direct:a", "Hello IO");
+
+        mock.assertIsSatisfied();
+    }
+
+    public void testException() throws Exception {
+        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm just exception");
+
+        template.sendBody("direct:a", "Hello Exception");
+
+        mock.assertIsSatisfied();
+    }
+
+    public void testMyBusinessException() throws Exception {
+        MockEndpoint mock = getMockEndpoint(BUSINESS_ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm my business is not going to well");
+
+        template.sendBody("direct:a", "Hello business");
+
+        mock.assertIsSatisfied();
+    }
+
+    public void testSecurityConfiguredWithTwoExceptions() throws Exception {
+        // test that we also handles a configuration with 2 or more exceptions
+        MockEndpoint mock = getMockEndpoint(SECURITY_ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm some security error");
+
+        template.sendBody("direct:a", "I am not allowed to do this");
+
+        mock.assertIsSatisfied();
+    }
+
+    public static class MyBaseBusinessException extends Exception {
+    }
+
+    public static class MyBusinessException extends MyBaseBusinessException {
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                // START SNIPPET: exceptionBuilder1
+                exception(NullPointerException.class)
+                    .maximumRedeliveries(1)
+                    .setHeader(MESSAGE_INFO, "Damm a NPE")
+                    .to(ERROR_QUEUE);
+
+                exception(IOException.class)
+                    .initialRedeliveryDelay(5000L)
+                    .maximumRedeliveries(3)
+                    .backOffMultiplier(1.0)
+                    .useExponentialBackOff()
+                    .setHeader(MESSAGE_INFO, "Damm somekind of IO exception")
+                    .to(ERROR_QUEUE);
+
+                exception(Exception.class)
+                    .initialRedeliveryDelay(1000L)
+                    .maximumRedeliveries(2)
+                    .setHeader(MESSAGE_INFO, "Damm just exception")
+                    .to(ERROR_QUEUE);
+                // END SNIPPET: exceptionBuilder1
+
+                exception(MyBaseBusinessException.class)
+                    .initialRedeliveryDelay(1000L)
+                    .maximumRedeliveries(3)
+                    .setHeader(MESSAGE_INFO, "Damm my business is not going to well")
+                    .to(BUSINESS_ERROR_QUEUE);
+
+                exception(GeneralSecurityException.class).exception(KeyException.class)
+                    .maximumRedeliveries(1)
+                    .setHeader(MESSAGE_INFO, "Damm some security error")
+                    .to(SECURITY_ERROR_QUEUE);
+
+
+                from("direct:a").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        String s = exchange.getIn().getBody(String.class);
+                        if ("Hello NPE".equals(s)) {
+                            throw new NullPointerException();
+                        } else if ("Hello IO".equals(s)) {
+                            throw new ConnectException("Forced for testing - can not connect to remote server");
+                        } else if ("Hello Exception".equals(s)) {
+                            throw new CamelExchangeException("Forced for testing", exchange);
+                        } else if ("Hello business".equals(s)) {
+                            throw new MyBusinessException();
+                        } else if ("I am not allowed to do this".equals(s)) {
+                            throw new KeyManagementException();
+                        }
+                        exchange.getOut().setBody("Hello World");
+                    }
+                }).to("mock:result");
+            }
+        };
+    }
+
+}
+

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ExceptionBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/CustomDataSetTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/CustomDataSetTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/CustomDataSetTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/CustomDataSetTest.java Mon Apr 14 09:38:25 2008
@@ -29,7 +29,7 @@
 import org.apache.camel.component.mock.MockEndpoint;
 
 /**
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public class CustomDataSetTest extends ContextTestSupport {
     protected DataSet dataSet = new DataSetSupport() {

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/CustomDataSetTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetConsumeTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetConsumeTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetConsumeTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetConsumeTest.java Mon Apr 14 09:38:25 2008
@@ -22,7 +22,7 @@
 import org.apache.camel.builder.RouteBuilder;
 
 /**
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public class DataSetConsumeTest extends ContextTestSupport {
     protected SimpleDataSet dataSet = new SimpleDataSet(20);

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetConsumeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTest.java Mon Apr 14 09:38:25 2008
@@ -23,7 +23,7 @@
 import org.apache.camel.component.mock.MockEndpoint;
 
 /**
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public class DataSetTest extends ContextTestSupport {
     protected SimpleDataSet dataSet = new SimpleDataSet(20);

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileFilterOnNameRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java Mon Apr 14 09:38:25 2008
@@ -1,78 +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.component.file;
-
-import java.io.File;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
-
-/**
- * For documentation how to write files using the FileProducer.
- */
-public class ToFileRouteTest extends ContextTestSupport {
-
-    // START SNIPPET: e1
-    public void testToFile() throws Exception {
-        template.sendBody("seda:reports", "This is a great report");
-
-        // give time for the file to be written before assertions
-        Thread.sleep(1000);
-
-        // assert the file exists
-        File file = new File("target/test-reports/report.txt");
-        assertTrue("The file should have been written", file.exists());
-    }
-
-    protected JndiRegistry createRegistry() throws Exception {
-        // bind our processor in the registry with the given id
-        JndiRegistry reg = super.createRegistry();
-        reg.bind("processReport", new ProcessReport());
-        return reg;
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                // the reports from the seda queue is processed by our processor
-                // before they are written to files in the target/reports directory
-                from("seda:reports").processRef("processReport").to("file://target/test-reports");
-            }
-        };
-    }
-
-    private class ProcessReport implements Processor {
-
-        public void process(Exchange exchange) throws Exception {
-            String body = exchange.getIn().getBody(String.class);
-            // do some business logic here
-
-            // set the output to the file
-            exchange.getOut().setBody(body);
-
-            // set the output filename using java code logic, notice that this is done by setting
-            // a special header property of the out exchange
-            exchange.getOut().setHeader(FileComponent.HEADER_FILE_NAME, "report.txt");
-        }
-
-    }
-    // END SNIPPET: e1
-
-}
+/**
+ * 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.file;
+
+import java.io.File;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ * For documentation how to write files using the FileProducer.
+ */
+public class ToFileRouteTest extends ContextTestSupport {
+
+    // START SNIPPET: e1
+    public void testToFile() throws Exception {
+        template.sendBody("seda:reports", "This is a great report");
+
+        // give time for the file to be written before assertions
+        Thread.sleep(1000);
+
+        // assert the file exists
+        File file = new File("target/test-reports/report.txt");
+        assertTrue("The file should have been written", file.exists());
+    }
+
+    protected JndiRegistry createRegistry() throws Exception {
+        // bind our processor in the registry with the given id
+        JndiRegistry reg = super.createRegistry();
+        reg.bind("processReport", new ProcessReport());
+        return reg;
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                // the reports from the seda queue is processed by our processor
+                // before they are written to files in the target/reports directory
+                from("seda:reports").processRef("processReport").to("file://target/test-reports");
+            }
+        };
+    }
+
+    private class ProcessReport implements Processor {
+
+        public void process(Exchange exchange) throws Exception {
+            String body = exchange.getIn().getBody(String.class);
+            // do some business logic here
+
+            // set the output to the file
+            exchange.getOut().setBody(body);
+
+            // set the output filename using java code logic, notice that this is done by setting
+            // a special header property of the out exchange
+            exchange.getOut().setHeader(FileComponent.HEADER_FILE_NAME, "report.txt");
+        }
+
+    }
+    // END SNIPPET: e1
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/ToFileRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/stream/StreamCacheConverterTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java Mon Apr 14 09:38:25 2008
@@ -1,176 +1,176 @@
-/**
- * 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.impl;
-
-import java.io.InputStream;
-import java.io.ByteArrayInputStream;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelTemplate;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.TestSupport;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.builder.RouteBuilder;
-
-/**
- * Unit test of the string data format.
- */
-public class StringDataFormatTest extends TestSupport {
-
-    private CamelContext context;
-    private CamelTemplate template;
-
-    protected void setUp() throws Exception {
-        context = new DefaultCamelContext();
-        template = new CamelTemplate(context);
-        template.start();
-    }
-
-    protected void tearDown() throws Exception {
-        template.stop();
-        context.stop();
-    }
-
-    public void testMarshalUTF8() throws Exception {
-        // NOTE: We are using a processor to do the assertions as the mock endpoint (Camel) does not yet support
-        // type conversion using byte and strings where you can set a charset encoding
-
-        // include a UTF-8 char in the text \u0E08 is a Thai elephant
-        final String title = "Hello Thai Elephant \u0E08";
-
-        context.addRoutes(new RouteBuilder() {
-            public void configure() {
-                from("direct:start").marshal().string("UTF-8").process(new MyBookProcessor("UTF-8", title));
-            }
-        });
-        context.start();
-
-        MyBook book = new MyBook();
-        book.setTitle(title);
-
-        template.sendBody("direct:start", book);
-    }
-
-    public void testMarshalNoEncoding() throws Exception {
-        // NOTE: We are using a processor to do the assertions as the mock endpoint (Camel) does not yet support
-        // type conversion using byte and strings where you can set a charset encoding
-
-        final String title = "Hello World";
-
-        context.addRoutes(new RouteBuilder() {
-            public void configure() {
-                from("direct:start").marshal().string().process(new MyBookProcessor(null, title));
-            }
-        });
-        context.start();
-
-        MyBook book = new MyBook();
-        book.setTitle(title);
-
-        template.sendBody("direct:start", book);
-    }
-
-
-    public void testUnmarshalUTF8() throws Exception {
-        // NOTE: Here we can use a MockEndpoint as we unmarshal the inputstream to String
-
-        // include a UTF-8 char in the text \u0E08 is a Thai elephant
-        final String title = "Hello Thai Elephant \u0E08";
-
-        context.addRoutes(new RouteBuilder() {
-            public void configure() {
-                from("direct:start").unmarshal().string("UTF-8").to("mock:unmarshal");
-            }
-        });
-        context.start();
-
-        byte[] bytes = title.getBytes("UTF-8");
-        InputStream in = new ByteArrayInputStream(bytes);
-
-        template.sendBody("direct:start", in);
-
-        MockEndpoint mock = context.getEndpoint("mock:unmarshal", MockEndpoint.class);
-        mock.setExpectedMessageCount(1);
-        mock.expectedBodiesReceived(title);
-    }
-
-    public void testUnmarshalNoEncoding() throws Exception {
-        // NOTE: Here we can use a MockEndpoint as we unmarshal the inputstream to String
-
-        final String title = "Hello World";
-
-        context.addRoutes(new RouteBuilder() {
-            public void configure() {
-                from("direct:start").unmarshal().string().to("mock:unmarshal");
-            }
-        });
-        context.start();
-
-        byte[] bytes = title.getBytes();
-        InputStream in = new ByteArrayInputStream(bytes);
-
-        template.sendBody("direct:start", in);
-
-        MockEndpoint mock = context.getEndpoint("mock:unmarshal", MockEndpoint.class);
-        mock.setExpectedMessageCount(1);
-        mock.expectedBodiesReceived(title);
-    }
-
-    private class MyBookProcessor implements Processor {
-
-        private String encoding;
-        private String title;
-
-        public MyBookProcessor(String encoding, String title) {
-            this.encoding = encoding;
-            this.title = title;
-        }
-
-        public void process(Exchange exchange) throws Exception {
-            byte[] body = exchange.getIn().getBody(byte[].class);
-
-            String text;
-            if (encoding != null) {
-                text = new String(body, encoding);
-            } else {
-                text = new String(body);
-            }
-
-            // does the testing
-            assertEquals(text, title);
-        }
-    }
-
-    private class MyBook {
-        private String title;
-
-        public String getTitle() {
-            return title;
-        }
-
-        public void setTitle(String title) {
-            this.title = title;
-        }
-
-        public String toString() {
-            // Camel will fallback to object toString converter and thus we get this text
-            return title;
-        }
-    }
-
-}
+/**
+ * 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.impl;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelTemplate;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.TestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * Unit test of the string data format.
+ */
+public class StringDataFormatTest extends TestSupport {
+
+    private CamelContext context;
+    private CamelTemplate template;
+
+    protected void setUp() throws Exception {
+        context = new DefaultCamelContext();
+        template = new CamelTemplate(context);
+        template.start();
+    }
+
+    protected void tearDown() throws Exception {
+        template.stop();
+        context.stop();
+    }
+
+    public void testMarshalUTF8() throws Exception {
+        // NOTE: We are using a processor to do the assertions as the mock endpoint (Camel) does not yet support
+        // type conversion using byte and strings where you can set a charset encoding
+
+        // include a UTF-8 char in the text \u0E08 is a Thai elephant
+        final String title = "Hello Thai Elephant \u0E08";
+
+        context.addRoutes(new RouteBuilder() {
+            public void configure() {
+                from("direct:start").marshal().string("UTF-8").process(new MyBookProcessor("UTF-8", title));
+            }
+        });
+        context.start();
+
+        MyBook book = new MyBook();
+        book.setTitle(title);
+
+        template.sendBody("direct:start", book);
+    }
+
+    public void testMarshalNoEncoding() throws Exception {
+        // NOTE: We are using a processor to do the assertions as the mock endpoint (Camel) does not yet support
+        // type conversion using byte and strings where you can set a charset encoding
+
+        final String title = "Hello World";
+
+        context.addRoutes(new RouteBuilder() {
+            public void configure() {
+                from("direct:start").marshal().string().process(new MyBookProcessor(null, title));
+            }
+        });
+        context.start();
+
+        MyBook book = new MyBook();
+        book.setTitle(title);
+
+        template.sendBody("direct:start", book);
+    }
+
+
+    public void testUnmarshalUTF8() throws Exception {
+        // NOTE: Here we can use a MockEndpoint as we unmarshal the inputstream to String
+
+        // include a UTF-8 char in the text \u0E08 is a Thai elephant
+        final String title = "Hello Thai Elephant \u0E08";
+
+        context.addRoutes(new RouteBuilder() {
+            public void configure() {
+                from("direct:start").unmarshal().string("UTF-8").to("mock:unmarshal");
+            }
+        });
+        context.start();
+
+        byte[] bytes = title.getBytes("UTF-8");
+        InputStream in = new ByteArrayInputStream(bytes);
+
+        template.sendBody("direct:start", in);
+
+        MockEndpoint mock = context.getEndpoint("mock:unmarshal", MockEndpoint.class);
+        mock.setExpectedMessageCount(1);
+        mock.expectedBodiesReceived(title);
+    }
+
+    public void testUnmarshalNoEncoding() throws Exception {
+        // NOTE: Here we can use a MockEndpoint as we unmarshal the inputstream to String
+
+        final String title = "Hello World";
+
+        context.addRoutes(new RouteBuilder() {
+            public void configure() {
+                from("direct:start").unmarshal().string().to("mock:unmarshal");
+            }
+        });
+        context.start();
+
+        byte[] bytes = title.getBytes();
+        InputStream in = new ByteArrayInputStream(bytes);
+
+        template.sendBody("direct:start", in);
+
+        MockEndpoint mock = context.getEndpoint("mock:unmarshal", MockEndpoint.class);
+        mock.setExpectedMessageCount(1);
+        mock.expectedBodiesReceived(title);
+    }
+
+    private class MyBookProcessor implements Processor {
+
+        private String encoding;
+        private String title;
+
+        public MyBookProcessor(String encoding, String title) {
+            this.encoding = encoding;
+            this.title = title;
+        }
+
+        public void process(Exchange exchange) throws Exception {
+            byte[] body = exchange.getIn().getBody(byte[].class);
+
+            String text;
+            if (encoding != null) {
+                text = new String(body, encoding);
+            } else {
+                text = new String(body);
+            }
+
+            // does the testing
+            assertEquals(text, title);
+        }
+    }
+
+    private class MyBook {
+        private String title;
+
+        public String getTitle() {
+            return title;
+        }
+
+        public void setTitle(String title) {
+            this.title = title;
+        }
+
+        public String toString() {
+            // Camel will fallback to object toString converter and thus we get this text
+            return title;
+        }
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/StringDataFormatTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java Mon Apr 14 09:38:25 2008
@@ -1,52 +1,52 @@
-/**
- * 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.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * Testing http://activemq.apache.org/camel/dsl.html
- */
-public class InterceptorLogTest extends ContextTestSupport {
-
-    public void testInterceptor() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        // TODO: we should only expect 1 message, but seda queues can sometimes send multiple
-        mock.expectedMinimumMessageCount(1);
-        mock.expectedBodiesReceived("Hello World");
-
-        template.sendBody("seda:foo", "Hello World");
-
-        mock.assertIsSatisfied();
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                // lets log all steps in all routes (must use proceed to let the exchange continue its
-                // normal route path instead of swallowing it here by our intercepter.
-                intercept().to("log:foo").proceed();
-
-                from("seda:foo").to("seda:bar");
-                from("seda:bar").to("mock:result");
-            }
-        };
-    }
-
-}
+/**
+ * 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.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * Testing http://activemq.apache.org/camel/dsl.html
+ */
+public class InterceptorLogTest extends ContextTestSupport {
+
+    public void testInterceptor() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        // TODO: we should only expect 1 message, but seda queues can sometimes send multiple
+        mock.expectedMinimumMessageCount(1);
+        mock.expectedBodiesReceived("Hello World");
+
+        template.sendBody("seda:foo", "Hello World");
+
+        mock.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                // lets log all steps in all routes (must use proceed to let the exchange continue its
+                // normal route path instead of swallowing it here by our intercepter.
+                intercept().to("log:foo").proceed();
+
+                from("seda:foo").to("seda:bar");
+                from("seda:bar").to("mock:result");
+            }
+        };
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java Mon Apr 14 09:38:25 2008
@@ -1,44 +1,44 @@
-/**
- * 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.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-public class ConvertBodyTest extends ContextTestSupport {
-    public void testConvertToInteger() throws Exception {
-
-        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result",
-                MockEndpoint.class);
-        resultEndpoint.expectedBodiesReceived(11);
-
-        template.sendBody("direct:start", "11");
-
-        resultEndpoint.assertIsSatisfied();
-    }
-
-    protected RouteBuilder createRouteBuilder() {
-        return new RouteBuilder() {
-            public void configure() {
-                from("direct:start").convertBodyTo(Integer.class).to("mock:result");
-            }
-        };
-    }
-
-}
+/**
+ * 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.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+public class ConvertBodyTest extends ContextTestSupport {
+    public void testConvertToInteger() throws Exception {
+
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result",
+                MockEndpoint.class);
+        resultEndpoint.expectedBodiesReceived(11);
+
+        template.sendBody("direct:start", "11");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").convertBodyTo(Integer.class).to("mock:result");
+            }
+        };
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ConvertBodyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java Mon Apr 14 09:38:25 2008
@@ -1,94 +1,94 @@
-/**
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.model.ExceptionType;
-
-public class ErrorHandlerSupportTest extends TestCase {
-
-    public void testOnePolicyChildFirst() {
-        List<Class> exceptions = new ArrayList<Class>();
-        exceptions.add(ChildException.class);
-        exceptions.add(ParentException.class);
-
-        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
-        support.addExceptionPolicy(new ExceptionType(exceptions));
-
-        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
-        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 1));
-    }
-
-    public void testOnePolicyChildLast() {
-        List<Class> exceptions = new ArrayList<Class>();
-        exceptions.add(ParentException.class);
-        exceptions.add(ChildException.class);
-
-        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
-        support.addExceptionPolicy(new ExceptionType(exceptions));
-
-        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 1));
-        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
-    }
-
-    public void testTwoPolicyChildFirst() {
-        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
-        support.addExceptionPolicy(new ExceptionType(ChildException.class));
-        support.addExceptionPolicy(new ExceptionType(ParentException.class));
-
-        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
-        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
-    }
-
-    public void testTwoPolicyChildLast() {
-        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
-        support.addExceptionPolicy(new ExceptionType(ParentException.class));
-        support.addExceptionPolicy(new ExceptionType(ChildException.class));
-
-        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
-        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
-    }
-
-    private static Class getExceptionPolicyFor(ErrorHandlerSupport support, Throwable childException,
-                                               int index) {
-        return support.getExceptionPolicy(null, childException).getExceptionClasses().get(index);
-    }
-
-    private static class ParentException extends Exception {
-    }
-
-    private static class ChildException extends ParentException {
-    }
-
-    private static class ShuntErrorHandlerSupport extends ErrorHandlerSupport {
-
-        protected void doStart() throws Exception {
-        }
-
-        protected void doStop() throws Exception {
-        }
-
-        public void process(Exchange exchange) throws Exception {
-        }
-    }
-
-}
+/**
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.model.ExceptionType;
+
+public class ErrorHandlerSupportTest extends TestCase {
+
+    public void testOnePolicyChildFirst() {
+        List<Class> exceptions = new ArrayList<Class>();
+        exceptions.add(ChildException.class);
+        exceptions.add(ParentException.class);
+
+        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
+        support.addExceptionPolicy(new ExceptionType(exceptions));
+
+        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
+        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 1));
+    }
+
+    public void testOnePolicyChildLast() {
+        List<Class> exceptions = new ArrayList<Class>();
+        exceptions.add(ParentException.class);
+        exceptions.add(ChildException.class);
+
+        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
+        support.addExceptionPolicy(new ExceptionType(exceptions));
+
+        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 1));
+        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
+    }
+
+    public void testTwoPolicyChildFirst() {
+        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
+        support.addExceptionPolicy(new ExceptionType(ChildException.class));
+        support.addExceptionPolicy(new ExceptionType(ParentException.class));
+
+        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
+        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
+    }
+
+    public void testTwoPolicyChildLast() {
+        ErrorHandlerSupport support = new ShuntErrorHandlerSupport();
+        support.addExceptionPolicy(new ExceptionType(ParentException.class));
+        support.addExceptionPolicy(new ExceptionType(ChildException.class));
+
+        assertEquals(ChildException.class, getExceptionPolicyFor(support, new ChildException(), 0));
+        assertEquals(ParentException.class, getExceptionPolicyFor(support, new ParentException(), 0));
+    }
+
+    private static Class getExceptionPolicyFor(ErrorHandlerSupport support, Throwable childException,
+                                               int index) {
+        return support.getExceptionPolicy(null, childException).getExceptionClasses().get(index);
+    }
+
+    private static class ParentException extends Exception {
+    }
+
+    private static class ChildException extends ParentException {
+    }
+
+    private static class ShuntErrorHandlerSupport extends ErrorHandlerSupport {
+
+        protected void doStart() throws Exception {
+        }
+
+        protected void doStop() throws Exception {
+        }
+
+        public void process(Exchange exchange) throws Exception {
+        }
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ExpressionAdapter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ExpressionAdapter.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ExpressionAdapter.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ExpressionAdapter.java Mon Apr 14 09:38:25 2008
@@ -24,7 +24,7 @@
  * A helper class for developers wishing to implement an {@link Expression} using Java code with a minimum amount
  * of code to write so that the developer only needs to implement the {@link #evaluate(Exchange)} method.
  *
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public abstract class ExpressionAdapter extends ExpressionSupport<Exchange> {
     public abstract Object evaluate(Exchange exchange);

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ExpressionAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java Mon Apr 14 09:38:25 2008
@@ -1,51 +1,51 @@
-/**
- * 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.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-
-/**
- * A simple interceptor routing test
- */
-public class InterceptorSimpleRouteTest extends ContextTestSupport {
-
-    public void testIntercept() throws Exception {
-        MockEndpoint intercepted = getMockEndpoint("mock:intercepted");
-        intercepted.expectedBodiesReceived("Hello London");
-
-        MockEndpoint result = getMockEndpoint("mock:result");
-        result.expectedBodiesReceived("Hello Paris");
-
-        template.sendBodyAndHeader("seda:a", "Hello London", "city", "London");
-        template.sendBodyAndHeader("seda:a", "Hello Paris", "city", "Paris");
-
-        intercepted.assertIsSatisfied();
-        result.assertIsSatisfied();
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() throws Exception {
-                intercept(header("city").isEqualTo("London")).to("mock:intercepted");
-                from("seda:a").to("mock:result");
-            }
-        };
-    }
-
-}
+/**
+ * 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.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * A simple interceptor routing test
+ */
+public class InterceptorSimpleRouteTest extends ContextTestSupport {
+
+    public void testIntercept() throws Exception {
+        MockEndpoint intercepted = getMockEndpoint("mock:intercepted");
+        intercepted.expectedBodiesReceived("Hello London");
+
+        MockEndpoint result = getMockEndpoint("mock:result");
+        result.expectedBodiesReceived("Hello Paris");
+
+        template.sendBodyAndHeader("seda:a", "Hello London", "city", "London");
+        template.sendBodyAndHeader("seda:a", "Hello Paris", "city", "Paris");
+
+        intercepted.assertIsSatisfied();
+        result.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                intercept(header("city").isEqualTo("London")).to("mock:intercepted");
+                from("seda:a").to("mock:result");
+            }
+        };
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptorSimpleRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MulticastStreamCachingTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MulticastStreamCachingTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MulticastStreamCachingTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MulticastStreamCachingTest.java Mon Apr 14 09:38:25 2008
@@ -29,7 +29,7 @@
 import org.apache.camel.component.mock.MockEndpoint;
 
 /**
- * @version $Revision: 1.1 $
+ * @version $Revision$
  */
 public class MulticastStreamCachingTest extends ContextTestSupport {
     protected Endpoint<Exchange> startEndpoint;

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MulticastStreamCachingTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/StaticRecipientListTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithErrorInHandleAndFinallyBlockTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithErrorInHandleAndFinallyBlockTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithFinallyBlockPipelineTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithHandlePipelineAndExceptionTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithInFlowExceptionTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithInFlowExceptionTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithInFlowExceptionTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithInFlowExceptionTest.java Mon Apr 14 09:38:25 2008
@@ -20,7 +20,7 @@
 import org.apache.camel.builder.RouteBuilder;
 
 /**
- * @version $Revision: 630568 $
+ * @version $Revision$
  */
 public class ValidationWithInFlowExceptionTest extends ValidationTest {
     protected RouteBuilder createRouteBuilder() {

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithInFlowExceptionTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithMultipleHandlesTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ValidationWithNestedFinallyBlockPipelineTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java Mon Apr 14 09:38:25 2008
@@ -1,95 +1,95 @@
-/**
- * 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.exceptionpolicy;
-
-import java.util.Map;
-
-import org.apache.camel.CamelException;
-import org.apache.camel.CamelExchangeException;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ExceptionType;
-
-/**
- * Unit test with a user plugged in exception policy to use instead of default.
- */
-public class CustomExceptionPolicyStrategyTest extends ContextTestSupport {
-
-    private static final String MESSAGE_INFO = "messageInfo";
-    private static final String ERROR_QUEUE = "mock:error";
-
-    public static class MyPolicyException extends Exception {
-    }
-
-    // START SNIPPET e2
-    public static class MyPolicy implements ExceptionPolicyStrategy {
-
-        public ExceptionType getExceptionPolicy(Map<Class, ExceptionType> exceptionPolicices,
-                                                Exchange exchange,
-                                                Throwable exception) {
-            // This is just an example that always forces the exception type configured
-            // with MyPolicyException to win.
-            return exceptionPolicices.get(MyPolicyException.class);
-        }
-    }
-    // END SNIPPET e2
-
-    public void testCustomPolicy() throws Exception {
-        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
-        mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm my policy exception");
-
-        template.sendBody("direct:a", "Hello Camel");
-
-        mock.assertIsSatisfied();
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            // START SNIPPET e1
-            public void configure() throws Exception {
-                // configure the error handler to use my policy instead of the default from Camel
-                errorHandler(deadLetterChannel().exceptionPolicyStrategy(new MyPolicy()));
-
-                exception(MyPolicyException.class)
-                    .maximumRedeliveries(1)
-                    .setHeader(MESSAGE_INFO, "Damm my policy exception")
-                    .to(ERROR_QUEUE);
-
-                exception(CamelException.class)
-                    .maximumRedeliveries(3)
-                    .setHeader(MESSAGE_INFO, "Damm a Camel exception")
-                    .to(ERROR_QUEUE);
-                // END SNIPPET e1
-
-                from("direct:a").process(new Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        String s = exchange.getIn().getBody(String.class);
-                        if ("Hello Camel".equals(s)) {
-                            throw new CamelExchangeException("Forced for testing", exchange);
-                        }
-                        exchange.getOut().setBody("Hello World");
-                    }
-                }).to("mock:result");
-            }
-        };
-    }
-
-}
+/**
+ * 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.exceptionpolicy;
+
+import java.util.Map;
+
+import org.apache.camel.CamelException;
+import org.apache.camel.CamelExchangeException;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.ExceptionType;
+
+/**
+ * Unit test with a user plugged in exception policy to use instead of default.
+ */
+public class CustomExceptionPolicyStrategyTest extends ContextTestSupport {
+
+    private static final String MESSAGE_INFO = "messageInfo";
+    private static final String ERROR_QUEUE = "mock:error";
+
+    public static class MyPolicyException extends Exception {
+    }
+
+    // START SNIPPET e2
+    public static class MyPolicy implements ExceptionPolicyStrategy {
+
+        public ExceptionType getExceptionPolicy(Map<Class, ExceptionType> exceptionPolicices,
+                                                Exchange exchange,
+                                                Throwable exception) {
+            // This is just an example that always forces the exception type configured
+            // with MyPolicyException to win.
+            return exceptionPolicices.get(MyPolicyException.class);
+        }
+    }
+    // END SNIPPET e2
+
+    public void testCustomPolicy() throws Exception {
+        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm my policy exception");
+
+        template.sendBody("direct:a", "Hello Camel");
+
+        mock.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            // START SNIPPET e1
+            public void configure() throws Exception {
+                // configure the error handler to use my policy instead of the default from Camel
+                errorHandler(deadLetterChannel().exceptionPolicyStrategy(new MyPolicy()));
+
+                exception(MyPolicyException.class)
+                    .maximumRedeliveries(1)
+                    .setHeader(MESSAGE_INFO, "Damm my policy exception")
+                    .to(ERROR_QUEUE);
+
+                exception(CamelException.class)
+                    .maximumRedeliveries(3)
+                    .setHeader(MESSAGE_INFO, "Damm a Camel exception")
+                    .to(ERROR_QUEUE);
+                // END SNIPPET e1
+
+                from("direct:a").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        String s = exchange.getIn().getBody(String.class);
+                        if ("Hello Camel".equals(s)) {
+                            throw new CamelExchangeException("Forced for testing", exchange);
+                        }
+                        exchange.getOut().setBody("Hello World");
+                    }
+                }).to("mock:result");
+            }
+        };
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/CustomExceptionPolicyStrategyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java?rev=647890&r1=647889&r2=647890&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java Mon Apr 14 09:38:25 2008
@@ -1,128 +1,128 @@
-/**
- * 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.exceptionpolicy;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.SocketException;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-import org.apache.camel.AlreadyStoppedException;
-import org.apache.camel.CamelExchangeException;
-import org.apache.camel.ExchangeTimedOutException;
-import org.apache.camel.ValidationException;
-import org.apache.camel.model.ExceptionType;
-
-/**
- * Unit test for DefaultExceptionPolicy 
- */
-public class DefaultExceptionPolicyStrategyTest extends TestCase {
-
-    private DefaultExceptionPolicyStrategy strategy;
-    private HashMap<Class, ExceptionType> policies;
-    private ExceptionType type1;
-    private ExceptionType type2;
-    private ExceptionType type3;
-
-    private void setupPolicies() {
-        strategy = new DefaultExceptionPolicyStrategy();
-        policies = new HashMap<Class, ExceptionType>();
-        type1 = new ExceptionType(CamelExchangeException.class);
-        type2 = new ExceptionType(Exception.class);
-        type3 = new ExceptionType(IOException.class);
-        policies.put(CamelExchangeException.class, type1);
-        policies.put(Exception.class, type2);
-        policies.put(IOException.class, type3);
-    }
-
-    private void setupPoliciesNoTopLevelException() {
-        // without the top level exception that can be used as fallback
-        strategy = new DefaultExceptionPolicyStrategy();
-        policies = new HashMap<Class, ExceptionType>();
-        type1 = new ExceptionType(CamelExchangeException.class);
-        type3 = new ExceptionType(IOException.class);
-        policies.put(CamelExchangeException.class, type1);
-        policies.put(IOException.class, type3);
-    }
-
-    public void testDirectMatch1() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new CamelExchangeException("", null));
-        assertEquals(type1, result);
-    }
-
-    public void testDirectMatch2() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new Exception(""));
-        assertEquals(type2, result);
-    }
-
-    public void testDirectMatch3() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new IOException(""));
-        assertEquals(type3, result);
-    }
-
-    public void testClosetMatch3() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ConnectException(""));
-        assertEquals(type3, result);
-
-        result = strategy.getExceptionPolicy(policies, null, new SocketException(""));
-        assertEquals(type3, result);
-
-        result = strategy.getExceptionPolicy(policies, null, new FileNotFoundException());
-        assertEquals(type3, result);
-    }
-
-    public void testClosetMatch2() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ClassCastException(""));
-        assertEquals(type2, result);
-
-        result = strategy.getExceptionPolicy(policies, null, new NumberFormatException(""));
-        assertEquals(type2, result);
-
-        result = strategy.getExceptionPolicy(policies, null, new NullPointerException());
-        assertEquals(type2, result);
-    }
-
-    public void testClosetMatch1() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ValidationException(null, ""));
-        assertEquals(type1, result);
-
-        result = strategy.getExceptionPolicy(policies, null, new ExchangeTimedOutException(null, 0));
-        assertEquals(type1, result);
-    }
-
-    public void testNoMatch1ThenMatchingJustException() {
-        setupPolicies();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
-        assertEquals(type2, result);
-    }
-
-    public void testNoMatch1ThenNull() {
-        setupPoliciesNoTopLevelException();
-        ExceptionType result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
-        assertNull("Should not find an exception policy to use", result);
-    }
-
-}
+/**
+ * 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.exceptionpolicy;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.SocketException;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import org.apache.camel.AlreadyStoppedException;
+import org.apache.camel.CamelExchangeException;
+import org.apache.camel.ExchangeTimedOutException;
+import org.apache.camel.ValidationException;
+import org.apache.camel.model.ExceptionType;
+
+/**
+ * Unit test for DefaultExceptionPolicy 
+ */
+public class DefaultExceptionPolicyStrategyTest extends TestCase {
+
+    private DefaultExceptionPolicyStrategy strategy;
+    private HashMap<Class, ExceptionType> policies;
+    private ExceptionType type1;
+    private ExceptionType type2;
+    private ExceptionType type3;
+
+    private void setupPolicies() {
+        strategy = new DefaultExceptionPolicyStrategy();
+        policies = new HashMap<Class, ExceptionType>();
+        type1 = new ExceptionType(CamelExchangeException.class);
+        type2 = new ExceptionType(Exception.class);
+        type3 = new ExceptionType(IOException.class);
+        policies.put(CamelExchangeException.class, type1);
+        policies.put(Exception.class, type2);
+        policies.put(IOException.class, type3);
+    }
+
+    private void setupPoliciesNoTopLevelException() {
+        // without the top level exception that can be used as fallback
+        strategy = new DefaultExceptionPolicyStrategy();
+        policies = new HashMap<Class, ExceptionType>();
+        type1 = new ExceptionType(CamelExchangeException.class);
+        type3 = new ExceptionType(IOException.class);
+        policies.put(CamelExchangeException.class, type1);
+        policies.put(IOException.class, type3);
+    }
+
+    public void testDirectMatch1() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new CamelExchangeException("", null));
+        assertEquals(type1, result);
+    }
+
+    public void testDirectMatch2() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new Exception(""));
+        assertEquals(type2, result);
+    }
+
+    public void testDirectMatch3() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new IOException(""));
+        assertEquals(type3, result);
+    }
+
+    public void testClosetMatch3() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ConnectException(""));
+        assertEquals(type3, result);
+
+        result = strategy.getExceptionPolicy(policies, null, new SocketException(""));
+        assertEquals(type3, result);
+
+        result = strategy.getExceptionPolicy(policies, null, new FileNotFoundException());
+        assertEquals(type3, result);
+    }
+
+    public void testClosetMatch2() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ClassCastException(""));
+        assertEquals(type2, result);
+
+        result = strategy.getExceptionPolicy(policies, null, new NumberFormatException(""));
+        assertEquals(type2, result);
+
+        result = strategy.getExceptionPolicy(policies, null, new NullPointerException());
+        assertEquals(type2, result);
+    }
+
+    public void testClosetMatch1() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new ValidationException(null, ""));
+        assertEquals(type1, result);
+
+        result = strategy.getExceptionPolicy(policies, null, new ExchangeTimedOutException(null, 0));
+        assertEquals(type1, result);
+    }
+
+    public void testNoMatch1ThenMatchingJustException() {
+        setupPolicies();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
+        assertEquals(type2, result);
+    }
+
+    public void testNoMatch1ThenNull() {
+        setupPoliciesNoTopLevelException();
+        ExceptionType result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
+        assertNull("Should not find an exception policy to use", result);
+    }
+
+}

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/interceptor/StreamCachingInterceptorTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipDataModificationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/converter/stream/test.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/camel-core/src/test/resources/org/apache/camel/converter/stream/test.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message