camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r895957 - in /camel/trunk/camel-core/src/test/java/org/apache/camel: component/file/ processor/ processor/aggregator/
Date Tue, 05 Jan 2010 09:25:17 GMT
Author: davsclaus
Date: Tue Jan  5 09:25:15 2010
New Revision: 895957

URL: http://svn.apache.org/viewvc?rev=895957&view=rev
Log:
Fixed unit tests on other boxes.

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileMarkerFileRecursiveDeleteOldLockFilesTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelFineGrainedErrorHandlingTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileMarkerFileRecursiveDeleteOldLockFilesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileMarkerFileRecursiveDeleteOldLockFilesTest.java?rev=895957&r1=895956&r2=895957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileMarkerFileRecursiveDeleteOldLockFilesTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileMarkerFileRecursiveDeleteOldLockFilesTest.java
Tue Jan  5 09:25:15 2010
@@ -54,7 +54,7 @@
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:target/oldlock?recursive=true").routeId("foo").noAutoStartup().to("mock:result");
+                from("file:target/oldlock?recursive=true&sortBy=file:name").routeId("foo").noAutoStartup().to("mock:result");
             }
         };
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java?rev=895957&r1=895956&r2=895957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
Tue Jan  5 09:25:15 2010
@@ -23,7 +23,7 @@
 import org.apache.camel.component.mock.MockEndpoint;
 
 /**
- * Unit test for shutting down whil DLC is sleeping in a redelivery.
+ * Unit test for shutting down while DLC is sleeping in a redelivery.
  */
 public class DeadLetterChannelRedeliveringWhileShutdownTest extends ContextTestSupport {
 
@@ -34,13 +34,14 @@
         mock.expectedBodiesReceived("Hello World");
 
         // send a message that causes redeliveries
-        template.sendBody("seda:damm", "Damm World");
+        template.sendBody("seda:damm", "Damn World");
         template.sendBody("direct:start", "Hello World");
 
         assertMockEndpointsSatisfied();
 
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should be faster than: " + delta, delta < 2500);
+        // cater for slow servers 
+        assertTrue("Should be faster than: " + delta, delta < 4000);
     }
 
     @Override
@@ -48,13 +49,13 @@
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(2).redeliverDelay(5000));
+                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(2).redeliverDelay(3000));
 
                 from("direct:start").delay(500).to("mock:result");
 
                 from("seda:damm").process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
-                        throw new IllegalArgumentException("Damm");
+                        throw new IllegalArgumentException("Damn");
                     }
                 });
             }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelFineGrainedErrorHandlingTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelFineGrainedErrorHandlingTest.java?rev=895957&r1=895956&r2=895957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelFineGrainedErrorHandlingTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListParallelFineGrainedErrorHandlingTest.java
Tue Jan  5 09:25:15 2010
@@ -114,7 +114,8 @@
         getMockEndpoint("mock:a").expectedMessageCount(1);
         getMockEndpoint("mock:foo").expectedMessageCount(1);
         getMockEndpoint("mock:bar").expectedMessageCount(1);
-        getMockEndpoint("mock:baz").expectedMessageCount(1);
+        // can be 0 or 1 depending whether the task was executed or not (we run parallel)
+        getMockEndpoint("mock:baz").expectedMinimumMessageCount(0);
 
         try {
             template.sendBody("direct:start", "Hello World");

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java?rev=895957&r1=895956&r2=895957&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
Tue Jan  5 09:25:15 2010
@@ -45,7 +45,7 @@
         Exchange out = result.getExchanges().get(0);
         List<Exchange> grouped = out.getProperty(Exchange.GROUPED_EXCHANGE, List.class);
 
-        assertEquals(2, grouped.size());
+        assertTrue("Should be either 2 or 4, was " + grouped.size(), grouped.size() == 2
|| grouped.size() == 4);
 
         assertEquals("100", grouped.get(0).getIn().getBody(String.class));
         assertEquals("150", grouped.get(1).getIn().getBody(String.class));
@@ -53,13 +53,16 @@
         // wait a bit for the remainder to come in
         Thread.sleep(1000);
 
-        out = result.getExchanges().get(1);
-        grouped = out.getProperty(Exchange.GROUPED_EXCHANGE, List.class);
+        if (result.getReceivedCounter() == 2) {
 
-        assertEquals(2, grouped.size());
+            out = result.getExchanges().get(1);
+            grouped = out.getProperty(Exchange.GROUPED_EXCHANGE, List.class);
 
-        assertEquals("130", grouped.get(0).getIn().getBody(String.class));
-        assertEquals("200", grouped.get(1).getIn().getBody(String.class));
+            assertEquals(2, grouped.size());
+
+            assertEquals("130", grouped.get(0).getIn().getBody(String.class));
+            assertEquals("200", grouped.get(1).getIn().getBody(String.class));
+        }
         // END SNIPPET: e2
     }
 



Mime
View raw message