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 2009/04/24 08:54:56 UTC

svn commit: r768186 [2/2] - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/management/ camel-core/...

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilTest.java?rev=768186&r1=768185&r2=768186&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilTest.java Fri Apr 24 06:54:55 2009
@@ -44,11 +44,14 @@
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(0));
+                // as its based on a unit test we do not have any delays between and do not log the stack trace
+                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(1).delay(0).logStackTrace(false));
 
                 // START SNIPPET: e1
                 // we want to use a predicate for retries so we can determine in our bean
-                // when retry should stop
+                // when retry should stop, notice it will overrule the global error handler
+                // where we defined at most 1 redelivery attempt. Here we will continue until
+                // the predicate false
                 onException(MyFunctionalException.class)
                         .retryUntil(bean("myRetryHandler"))
                         .handled(true)

Modified: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySimplifiedHandle404Test.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySimplifiedHandle404Test.java?rev=768186&r1=768185&r2=768186&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySimplifiedHandle404Test.java (original)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySimplifiedHandle404Test.java Fri Apr 24 06:54:55 2009
@@ -54,7 +54,7 @@
                 // HttpOperationFailedException in case of failures.
                 // This allows us to handle all responses in the aggregation strategy where we can check the HTTP response code
                 // and decide what to do. As this is based on an unit test we assert the code is 404
-                from("direct:start").enrich("http://localhost:8123/myserver?throwExceptionOnFailure=false&user=Camel", new AggregationStrategy() {
+                from("direct:start").enrich("http://localhost:8222/myserver?throwExceptionOnFailure=false&user=Camel", new AggregationStrategy() {
                     public Exchange aggregate(Exchange original, Exchange resource) {
                         // get the response code
                         Integer code = resource.getOut().getHeader(HttpConstants.HTTP_RESPONSE_CODE, Integer.class);
@@ -64,7 +64,7 @@
                 }).to("mock:result");
 
                 // this is our jetty server where we simulate the 404
-                from("jetty://http://localhost:8123/myserver")
+                from("jetty://http://localhost:8222/myserver")
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
                                 exchange.getOut().setBody("Page not found");

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ErrorHandlerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ErrorHandlerTest.java?rev=768186&r1=768185&r2=768186&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ErrorHandlerTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/ErrorHandlerTest.java Fri Apr 24 06:54:55 2009
@@ -19,8 +19,7 @@
 import java.util.List;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Processor;
+import org.apache.camel.Channel;
 import org.apache.camel.Route;
 import org.apache.camel.impl.EventDrivenConsumerRoute;
 import org.apache.camel.processor.DeadLetterChannel;
@@ -30,6 +29,7 @@
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class ErrorHandlerTest extends SpringTestSupport {
+
     protected AbstractXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/spring/config/errorHandler.xml");
     }
@@ -39,13 +39,10 @@
         List<Route> list = context.getRoutes();
         assertEquals("Number routes created" + list, 2, list.size());
         for (Route route : list) {
-
             EventDrivenConsumerRoute consumerRoute = assertIsInstanceOf(EventDrivenConsumerRoute.class, route);
-            Processor processor = consumerRoute.getProcessor();
-            processor = unwrap(processor);
-
-            DeadLetterChannel deadLetterChannel = assertIsInstanceOf(DeadLetterChannel.class, processor);
+            Channel channel = unwrapChannel(consumerRoute.getProcessor());
 
+            DeadLetterChannel deadLetterChannel = assertIsInstanceOf(DeadLetterChannel.class, channel.getErrorHandler());
             RedeliveryPolicy redeliveryPolicy = deadLetterChannel.getRedeliveryPolicy();
 
             assertEquals("getMaximumRedeliveries()", 1, redeliveryPolicy.getMaximumRedeliveries());