camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r886778 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java
Date Thu, 03 Dec 2009 13:34:36 GMT
Author: davsclaus
Date: Thu Dec  3 13:34:36 2009
New Revision: 886778

URL: http://svn.apache.org/viewvc?rev=886778&view=rev
Log:
Fixed unit test

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java?rev=886778&r1=886777&r2=886778&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java Thu Dec
 3 13:34:36 2009
@@ -36,7 +36,6 @@
 import org.apache.camel.NoSuchPropertyException;
 import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.TypeConverter;
-import org.apache.camel.impl.DefaultUnitOfWork;
 import org.apache.camel.spi.UnitOfWork;
 
 /**
@@ -64,20 +63,6 @@
     }
 
     /**
-     * Done the given {@link Exchange} which allows {@link org.apache.camel.spi.UnitOfWork}
-     * to done.
-     *
-     * @param exchange the given exchange
-     */
-    public static void done(Exchange exchange) {
-        if (exchange.getUnitOfWork() == null) {
-            UnitOfWork uow = new DefaultUnitOfWork(exchange);
-            exchange.setUnitOfWork(uow);
-        }
-        exchange.getUnitOfWork().done(exchange);
-    }
-
-    /**
      * Attempts to resolve the endpoint for the given value
      *
      * @param exchange the message exchange being processed

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java?rev=886778&r1=886777&r2=886778&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpPollingConsumerTest.java
Thu Dec  3 13:34:36 2009
@@ -21,7 +21,6 @@
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultUnitOfWork;
 import org.apache.camel.spi.UnitOfWork;
-import org.apache.camel.util.ExchangeHelper;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -57,7 +56,7 @@
 
         boolean done = false;
         while (!done) {
-            Exchange exchange = consumer.receive(2000);
+            Exchange exchange = consumer.receive(5000);
             if (exchange == null) {
                 done = true;
                 break;
@@ -67,8 +66,13 @@
             template.sendBody("mock:result", body);
 
             // must done to move the files
-            ExchangeHelper.done(exchange);
+            if (exchange.getUnitOfWork() == null) {
+                UnitOfWork uow = new DefaultUnitOfWork(exchange);
+                exchange.setUnitOfWork(uow);
+            }
+            exchange.getUnitOfWork().done(exchange);
         }
+
         consumer.stop();
 
         assertMockEndpointsSatisfied();



Mime
View raw message