Author: ningjiang
Date: Wed Dec 9 14:12:37 2009
New Revision: 888810
URL: http://svn.apache.org/viewvc?rev=888810&view=rev
Log:
Try to fix the ftp error on windows
Modified:
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryAsAbsolutePathTest.java
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryTest.java
Modified:
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryAsAbsolutePathTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryAsAbsolutePathTest.java?rev=888810&r1=888809&r2=888810&view=diff
==============================================================================
---
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryAsAbsolutePathTest.java
(original)
+++
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryAsAbsolutePathTest.java
Wed Dec 9 14:12:37 2009
@@ -72,7 +72,7 @@
assertMockEndpointsSatisfied();
// give test some time to close file resources
- Thread.sleep(2000);
+ Thread.sleep(6000);
// now the lwd file should be deleted
File local = new File("target/lwd/hello.txt").getAbsoluteFile();
Modified:
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryTest.java?rev=888810&r1=888809&r2=888810&view=diff
==============================================================================
---
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryTest.java
(original)
+++
camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerLocalWorkDirectoryTest.java
Wed Dec 9 14:12:37 2009
@@ -35,7 +35,8 @@
public class FtpConsumerLocalWorkDirectoryTest extends FtpServerTestSupport {
protected String getFtpUrl() {
- return "ftp://ad...@localhost:" + getPort() +
"/lwd/?password=admin&delay=5000&localWorkDirectory=target/lwd";
+ return "ftp://ad...@localhost:" + getPort()
+ +
"/lwd/?password=admin&delay=5000&localWorkDirectory=target/lwd&noop=true";
}
@Override
@@ -48,7 +49,8 @@
}
private void prepareFtpServer() throws Exception {
- // prepares the FTP Server by creating a file on the server that we
want to unit
+ // prepares the FTP Server by creating a file on the server that we
want
+ // to unit
// test that we can pool
Endpoint endpoint = context.getEndpoint(getFtpUrl());
Exchange exchange = endpoint.createExchange();
@@ -69,16 +71,16 @@
assertMockEndpointsSatisfied();
// give test some time to close file resources
- Thread.sleep(2000);
-
- // now the lwd file should be deleted
- File local = new File("target/lwd/hello.txt").getAbsoluteFile();
- assertFalse("Local work file should have been deleted",
local.exists());
+ Thread.sleep(6000);
// and the out file should exists
File out = new File("target/out/hello.txt").getAbsoluteFile();
assertTrue("file should exists", out.exists());
assertEquals("Hello World", IOConverter.toString(out, null));
+
+ // now the lwd file should be deleted
+ File local = new File("target/lwd/hello.txt").getAbsoluteFile();
+ assertFalse("Local work file should have been deleted",
local.exists());
}
protected RouteBuilder createRouteBuilder() throws Exception {
@@ -88,7 +90,7 @@
public void process(Exchange exchange) throws Exception {
File body = exchange.getIn().getBody(File.class);
assertNotNull(body);
- assertTrue("Local work file should exists",
body.exists());
+ assertTrue("Local work file should exists",
body.exists());
assertEquals(FileUtil.normalizePath("target/lwd/hello.txt"), body.getPath());
}
}).to("mock:result", "file://target/out");
@@ -96,4 +98,4 @@
};
}
-}
\ No newline at end of file
+}