You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2008/12/26 11:33:44 UTC
svn commit: r729477 -
/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileExclusiveReadRenameStrategyTest.java
Author: davsclaus
Date: Fri Dec 26 02:33:44 2008
New Revision: 729477
URL: http://svn.apache.org/viewvc?rev=729477&view=rev
Log:
CAMEL-1195: Some unit tests only possible on Windows such as the rename readlock strategy
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=729477&r1=729476&r2=729477&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 Fri Dec 26 02:33:44 2008
@@ -34,6 +34,7 @@
public class FileExclusiveReadRenameStrategyTest extends ContextTestSupport {
private static final Log LOG = LogFactory.getLog(FileExclusiveReadRenameStrategyTest.class);
+ private static final boolean ON_WINDOWS = System.getProperty("os.name").startsWith("Windows");
private String fileUrl = "file://target/exclusiveread/slowfile?consumer.delay=500&readLock=rename";
@Override
@@ -42,6 +43,11 @@
}
public void testPoolIn3SecondsButNoFiles() throws Exception {
+ // can only be tested on Windows
+ if (!ON_WINDOWS) {
+ return;
+ }
+
deleteDirectory("./target/exclusiveread");
createDirectory("./target/exclusiveread/slowfile");
MockEndpoint mock = getMockEndpoint("mock:result");
@@ -53,8 +59,12 @@
mock.assertIsSatisfied();
}
- //TODO fix the test failure in no windows box
- public void xtestPollFileWhileSlowFileIsBeingWritten() throws Exception {
+ public void testPollFileWhileSlowFileIsBeingWritten() throws Exception {
+ // can only be tested on Windows
+ if (!ON_WINDOWS) {
+ return;
+ }
+
deleteDirectory("./target/exclusiveread");
createDirectory("./target/exclusiveread/slowfile");
@@ -79,6 +89,11 @@
}
public void testPollFileWhileSlowFileIsBeingWrittenWithTimeout() throws Exception {
+ // can only be tested on Windows
+ if (!ON_WINDOWS) {
+ return;
+ }
+
deleteDirectory("./target/exclusiveread");
createDirectory("./target/exclusiveread/slowfile");
@@ -102,8 +117,12 @@
mock.assertIsSatisfied();
}
- //TODO fix the test failure in no windows box
- public void xtestPollFileWhileSlowFileIsBeingWrittenWithTimeoutAndNoop() throws Exception {
+ public void testPollFileWhileSlowFileIsBeingWrittenWithTimeoutAndNoop() throws Exception {
+ // can only be tested on Windows
+ if (!ON_WINDOWS) {
+ return;
+ }
+
deleteDirectory("./target/exclusiveread");
createDirectory("./target/exclusiveread/slowfile");
// to test that if noop and thus idempotent we will retry to consume the file