You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/12/24 08:04:55 UTC
svn commit: r729257 -
/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java
Author: ningjiang
Date: Tue Dec 23 23:04:55 2008
New Revision: 729257
URL: http://svn.apache.org/viewvc?rev=729257&view=rev
Log:
Try to fixed the FileExclusiveReadRenameStrategyTest failures in Linux Box
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java?rev=729257&r1=729256&r2=729257&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java Tue Dec 23 23:04:55 2008
@@ -54,6 +54,9 @@
}
public void testPollFileWhileSlowFileIsBeingWritten() throws Exception {
+ deleteDirectory("./target/exclusiveread");
+ createDirectory("./target/exclusiveread/slowfile");
+
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
@@ -62,9 +65,7 @@
}
});
context.start();
-
- deleteDirectory("./target/exclusiveread");
- createDirectory("./target/exclusiveread/slowfile");
+
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
mock.expectedBodiesReceived("Hello WorldLine #0Line #1Line #2Bye World");
@@ -77,6 +78,9 @@
}
public void testPollFileWhileSlowFileIsBeingWrittenWithTimeout() throws Exception {
+ deleteDirectory("./target/exclusiveread");
+ createDirectory("./target/exclusiveread/slowfile");
+
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
@@ -85,9 +89,7 @@
}
});
context.start();
-
- deleteDirectory("./target/exclusiveread");
- createDirectory("./target/exclusiveread/slowfile");
+
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(0);
mock.setMinimumResultWaitTime(2000);
@@ -100,6 +102,8 @@
}
public void testPollFileWhileSlowFileIsBeingWrittenWithTimeoutAndNoop() throws Exception {
+ deleteDirectory("./target/exclusiveread");
+ createDirectory("./target/exclusiveread/slowfile");
// to test that if noop and thus idempotent we will retry to consume the file
// the 2nd. time since the first time we could not get the read lock due timeout
// so the file should only be marked in the idempotent repository if we could process it
@@ -111,11 +115,9 @@
}
});
context.start();
-
- deleteDirectory("./target/exclusiveread");
- createDirectory("./target/exclusiveread/slowfile");
+
MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedMessageCount(1);
+ mock.expectedMessageCount(1);
mock.setMinimumResultWaitTime(3000);
mock.setResultWaitTime(5000);