You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2008/08/28 07:28:39 UTC

svn commit: r689722 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java

Author: davsclaus
Date: Wed Aug 27 22:28:39 2008
New Revision: 689722

URL: http://svn.apache.org/viewvc?rev=689722&view=rev
Log:
CAMEL-794: error handler and thread() type

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java?rev=689722&r1=689721&r2=689722&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/BelasThreadErrorHandlerIssue794Test.java Wed Aug 27 22:28:39 2008
@@ -43,9 +43,7 @@
         assertEquals(3, counter); // One call + 2 re-deliveries
     }
 
-    // TODO: Look into these unit tests
-
-/*    public void testThreadErrorHandlerRedeliveryBeforeThread() throws Exception {
+    public void testThreadErrorHandlerRedeliveryBeforeThread() throws Exception {
         counter = 0;
 
         // We expect the exchange here after 1 delivery and 2 re-deliveries
@@ -57,9 +55,9 @@
         template.sendBody("direct:inBeforeThread", "Hello World");
 
         mock.assertIsSatisfied();
-    }*/
+    }
 
-/*    public void testThreadErrorHandlerCallBeforeThread() throws Exception {
+    public void testThreadErrorHandlerCallBeforeThread() throws Exception {
         counter = 0;
 
         template.sendBody("direct:inBeforeThread", "Hello World");
@@ -71,7 +69,7 @@
         counter = 0;
 
         // We expect the exchange here after 1 delivery and 2 re-deliveries
-        MockEndpoint mock= getMockEndpoint("mock:afterThread");
+        MockEndpoint mock= getMockEndpoint("mock:deafultAfterThread");
         mock.expectedMessageCount(1);
         mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
         mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(2);
@@ -87,7 +85,7 @@
         template.sendBody("direct:inAfterThread", "Hello World");
 
         assertEquals(3, counter); // One call + 2 re-deliveries
-    }*/
+    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
@@ -112,9 +110,11 @@
             			}
         			});
 
+                errorHandler(deadLetterChannel("mock:deafultAfterThread").maximumRedeliveries(2));
                 from("direct:inAfterThread")
                 	.thread(2)
-                	.errorHandler(deadLetterChannel("mock:afterThread").maximumRedeliveries(2))
+                    // NOTE: this error handler below is not used as we must set it before the thread type
+                	.errorHandler(deadLetterChannel("mock:afterThread").maximumRedeliveries(1))
                 	.process(new Processor() {
                 		public void process(Exchange exchange) throws Exception {
                 			counter++;