Author: bvahdat
Date: Wed Oct 31 04:48:10 2012
New Revision: 1403975

URL: http://svn.apache.org/viewvc?rev=1403975&view=rev
Log:
Merged revisions 1403971 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1403971 | bvahdat | 2012-10-31 05:29:45 +0100 (Mi, 31 Okt 2012) | 1 line
  
  Polished.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    
camel/branches/camel-2.10.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1403971

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.10.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java?rev=1403975&r1=1403974&r2=1403975&view=diff
==============================================================================
--- 
camel/branches/camel-2.10.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
 (original)
+++ 
camel/branches/camel-2.10.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
 Wed Oct 31 04:48:10 2012
@@ -17,9 +17,6 @@
 package org.apache.camel.component.file.remote;
 
 import org.apache.camel.builder.RouteBuilder;
-
-import org.apache.commons.net.ftp.FTPClient;
-
 import org.junit.Test;
 
 public class FtpConsumerDisconnectTest extends FtpServerTestSupport {
@@ -34,7 +31,7 @@ public class FtpConsumerDisconnectTest e
         
         // force the singleton FtpEndpoint to make use of a custom FTPClient
         FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), 
FtpEndpoint.class);
-        endpoint.setFtpClient(new FTPClient());
+        endpoint.setFtpClient(endpoint.createFtpClient());
 
         sendFile(getFtpUrl(), "Hello World", "claus.txt");
     }
@@ -54,14 +51,13 @@ public class FtpConsumerDisconnectTest e
         getMockEndpoint("mock:result").expectedMessageCount(1);
         assertMockEndpointsSatisfied();
 
-        // give time for ftp consumer to disconnect (delay is 5000 which is 
long enough to avoid a second poll cycle)
+        // give time for ftp consumer to disconnect (delay is 5000 ms which is 
long enough to avoid a second poll cycle)
         Thread.sleep(2000);
 
         FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), 
FtpEndpoint.class);
+        assertFalse("The FTPClient should be already disconnected", 
endpoint.getFtpClient().isConnected());
         assertTrue("The FtpEndpoint is configured to disconnect after each 
poll", endpoint.isDisconnect());
 
-        FTPClient ftpClient = endpoint.getFtpClient();
-        assertFalse("The FTPClient should not be connected", 
ftpClient.isConnected());
     }
 
 }
\ No newline at end of file


Reply via email to