camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r791384 - in /camel/branches/camel-1.x: camel-core/src/test/java/org/apache/camel/processor/ components/camel-amqp/src/test/java/org/apache/camel/component/amqp/ components/camel-bam/src/test/java/org/apache/camel/bam/ components/camel-ftp/...
Date Mon, 06 Jul 2009 05:12:32 GMT
Author: davsclaus
Date: Mon Jul  6 05:12:32 2009
New Revision: 791384

URL: http://svn.apache.org/viewvc?rev=791384&view=rev
Log:
Unit test to pass on slower boxes.

Modified:
    camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
    camel/branches/camel-1.x/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
    camel/branches/camel-1.x/components/camel-bam/src/test/java/org/apache/camel/bam/MultipleActivitiesConcurrentlyTest.java
    camel/branches/camel-1.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
    camel/branches/camel-1.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
    camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
    camel/branches/camel-1.x/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDefaultDelayForMailConsumeTest.java
    camel/branches/camel-1.x/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/CamelGreeterTest.java

Modified: camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
(original)
+++ camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/ThrottlerTest.java
Mon Jul  6 05:12:32 2009
@@ -34,7 +34,7 @@
     public void testSendLotsOfMessagesButOnly3GetThrough() throws Exception {
         MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
         resultEndpoint.expectedMessageCount(3);
-        resultEndpoint.setResultWaitTime(1000);
+        resultEndpoint.setResultWaitTime(2 * 1000);
 
         for (int i = 0; i < messageCount; i++) {
             template.sendBody("seda:a", "<message>" + i + "</message>");

Modified: camel/branches/camel-1.x/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
Mon Jul  6 05:12:32 2009
@@ -38,6 +38,11 @@
 
         resultEndpoint.message(0).header("cheese").isEqualTo(123);
 
+        try {
+            Thread.sleep(1000);
+        } catch (InterruptedException ex) {
+            // ignore.
+        } 
         sendExchange(expectedBody);
         if (System.getProperty("os.name").startsWith("Windows")) {
             // send the message twice to walk around the AMQP's drop first message issue
on Windows box

Modified: camel/branches/camel-1.x/components/camel-bam/src/test/java/org/apache/camel/bam/MultipleActivitiesConcurrentlyTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-bam/src/test/java/org/apache/camel/bam/MultipleActivitiesConcurrentlyTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-bam/src/test/java/org/apache/camel/bam/MultipleActivitiesConcurrentlyTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-bam/src/test/java/org/apache/camel/bam/MultipleActivitiesConcurrentlyTest.java
Mon Jul  6 05:12:32 2009
@@ -57,5 +57,12 @@
         errorTimeout = 5;
 
         super.setUp();
+
+        // Pause to make sure everything is set up. 
+        try {
+            Thread.sleep(8000);
+        } catch (InterruptedException ex) {
+            // ignore.
+        }
     }
 }

Modified: camel/branches/camel-1.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
(original)
+++ camel/branches/camel-1.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
Mon Jul  6 05:12:32 2009
@@ -69,7 +69,19 @@
             if (log.isDebugEnabled()) {
                 log.debug("Not connected/logged in, connecting to " + remoteServer());
             }
-            loggedIn = FtpUtils.connect(client, endpoint.getConfiguration());
+
+            try {
+                loggedIn = FtpUtils.connect(client, endpoint.getConfiguration());
+            } catch (java.net.ConnectException ce) {
+                // Wait a bit to make sure we have something to connect to and
+                // try once more. 
+                try {
+                    Thread.sleep(3000);
+                } catch (InterruptedException ie) {
+                    // ignore.
+                }
+                loggedIn = FtpUtils.connect(client, endpoint.getConfiguration());
+            }
             if (!loggedIn) {
                 return;
             }

Modified: camel/branches/camel-1.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerExcludeNameTest.java
Mon Jul  6 05:12:32 2009
@@ -30,7 +30,7 @@
     private String ftpUrl = "ftp://admin@localhost:" + port + "/excludename?password=admin"
         + "&consumer.excludedNamePrefix=secret&consumer.excludedNamePostfix=xml";
 
-    public void testExludePreAndPostfixes() throws Exception {
+    public void testExcludePreAndPostfixes() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(2);
         mock.expectedBodiesReceived("Reports", "Reports");

Modified: camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
Mon Jul  6 05:12:32 2009
@@ -30,7 +30,7 @@
  */
 public class HttpProducerJMXBeansIssueTest extends ContextTestSupport {
 
-private static final Log LOG = LogFactory.getLog(HttpProducerJMXBeansIssueTest.class);
+    private static final Log LOG = LogFactory.getLog(HttpProducerJMXBeansIssueTest.class);
 
     @Override
     public void setUp() throws Exception {

Modified: camel/branches/camel-1.x/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDefaultDelayForMailConsumeTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDefaultDelayForMailConsumeTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDefaultDelayForMailConsumeTest.java
(original)
+++ camel/branches/camel-1.x/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailDefaultDelayForMailConsumeTest.java
Mon Jul  6 05:12:32 2009
@@ -29,19 +29,21 @@
         template.sendBody("smtp://bond@localhost", "Hello London");
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello London");
-        // first poll should happend immediately
-        mock.setResultWaitTime(2000L);
+        // first poll should happen immediately
+        mock.setResultWaitTime(4 * 1000L);
         mock.assertIsSatisfied();
 
         long start = System.currentTimeMillis();
         mock.reset();
         template.sendBody("smtp://bond@localhost", "Hello Paris");
         mock.expectedBodiesReceived("Hello Paris");
-        // poll next mail and that is should be done within the default delay + 2 sec slack
-        mock.setResultWaitTime(MailConsumer.DEFAULT_CONSUMER_DELAY + 2000L);
+        // poll next mail and that should be done within the default delay + 3 sec slack
+        mock.setResultWaitTime(MailConsumer.DEFAULT_CONSUMER_DELAY + 4 * 1000L);
         mock.assertIsSatisfied();
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Camel should not default poll the mailbox to often", delta > MailConsumer.DEFAULT_CONSUMER_DELAY
- 1000L);
+        assertTrue("Camel should not default poll the mailbox to often. delta: "
+            + delta + " > " + (MailConsumer.DEFAULT_CONSUMER_DELAY - 4 * 1000L),
+            delta > MailConsumer.DEFAULT_CONSUMER_DELAY - 3 * 1000L);
     }
 
 

Modified: camel/branches/camel-1.x/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/CamelGreeterTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/CamelGreeterTest.java?rev=791384&r1=791383&r2=791384&view=diff
==============================================================================
--- camel/branches/camel-1.x/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/CamelGreeterTest.java
(original)
+++ camel/branches/camel-1.x/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/CamelGreeterTest.java
Mon Jul  6 05:12:32 2009
@@ -75,7 +75,7 @@
         template.sendBodyAndHeader("jms:requestQueue", "Willem", CxfConstants.OPERATION_NAME,
"greetMe");
 
         // Sleep a while and wait for the message whole processing
-        Thread.sleep(4000);
+        Thread.sleep(8000);
 
         MockEndpoint.assertIsSatisfied(camelContext);
         List<Exchange> list = resultEndpoint.getReceivedExchanges();



Mime
View raw message