You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2012/10/31 05:46:29 UTC
svn commit: r1403974 - in /camel/branches/camel-2.9.x: ./
components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
Author: bvahdat
Date: Wed Oct 31 04:46:29 2012
New Revision: 1403974
URL: http://svn.apache.org/viewvc?rev=1403974&view=rev
Log:
Merged revisions 1403972 via svnmerge from
https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x
................
r1403972 | bvahdat | 2012-10-31 05:42:45 +0100 (Mi, 31 Okt 2012) | 9 lines
Merged revisions 1403863 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1403863 | bvahdat | 2012-10-30 21:48:08 +0100 (Di, 30 Okt 2012) | 1 line
Added asserts verifying the effect of the disconnect option.
........
................
Modified:
camel/branches/camel-2.9.x/ (props changed)
camel/branches/camel-2.9.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1403863
Merged /camel/branches/camel-2.10.x:r1403972
Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.9.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.9.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java?rev=1403974&r1=1403973&r2=1403974&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java (original)
+++ camel/branches/camel-2.9.x/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerDisconnectTest.java Wed Oct 31 04:46:29 2012
@@ -17,6 +17,9 @@
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 {
@@ -28,6 +31,11 @@ public class FtpConsumerDisconnectTest e
@Override
public void setUp() throws Exception {
super.setUp();
+
+ // force the singleton FtpEndpoint to make use of a custom FTPClient
+ FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
+ endpoint.setFtpClient(new FTPClient());
+
sendFile(getFtpUrl(), "Hello World", "claus.txt");
}
@@ -46,8 +54,14 @@ public class FtpConsumerDisconnectTest e
getMockEndpoint("mock:result").expectedMessageCount(1);
assertMockEndpointsSatisfied();
- // give time for ftp consumer to disconnect
+ // give time for ftp consumer to disconnect (delay is 5000 which is long enough to avoid a second poll cycle)
Thread.sleep(2000);
+
+ FtpEndpoint<?> endpoint = context.getEndpoint(getFtpUrl(), FtpEndpoint.class);
+ 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