Author: bvahdat
Date: Wed Oct 31 04:29:45 2012
New Revision: 1403971

URL: http://svn.apache.org/viewvc?rev=1403971&view=rev
Log:
Polished.

Modified:
    
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java

Modified: 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java?rev=1403971&r1=1403970&r2=1403971&view=diff
==============================================================================
--- 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
 (original)
+++ 
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
 Wed Oct 31 04:29:45 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