You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/29 08:27:50 UTC
[camel] branch master updated: CAMEL-13915 - camel-file-watch - CI
test failures
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new a81def1 CAMEL-13915 - camel-file-watch - CI test failures
a81def1 is described below
commit a81def11de1b18e50bcb0e6a3bc764427109cb5f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 29 10:27:21 2019 +0200
CAMEL-13915 - camel-file-watch - CI test failures
---
.../org/apache/camel/component/file/watch/FileWatchConsumer.java | 9 ++++++---
.../camel/component/file/watch/FileWatchComponentTest.java | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
index a0f5718..8b79d4b 100644
--- a/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
+++ b/components/camel-file-watch/src/main/java/org/apache/camel/component/file/watch/FileWatchConsumer.java
@@ -37,6 +37,7 @@ import org.apache.camel.component.file.watch.constants.FileEvent;
import org.apache.camel.component.file.watch.utils.PathUtils;
import org.apache.camel.support.DefaultConsumer;
import org.apache.camel.util.AntPathMatcher;
+import org.apache.camel.util.ObjectHelper;
/**
* The file-watch consumer.
@@ -159,9 +160,11 @@ public class FileWatchConsumer extends DefaultConsumer {
}
private boolean matchFilters(FileEvent fileEvent) {
- if (!getEndpoint().getEvents().contains(fileEvent.getEventType())) {
- return false;
- }
+ if (ObjectHelper.isNotEmpty(getEndpoint().getEvents())) {
+ if (!getEndpoint().getEvents().contains(fileEvent.getEventType())) {
+ return false;
+ }
+ }
if (!getEndpoint().isRecursive()) {
// On some platforms (eg macOS) is WatchService always recursive,
diff --git a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java
index 48bab63..65e4179 100644
--- a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java
+++ b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java
@@ -52,11 +52,11 @@ public class FileWatchComponentTest extends FileWatchComponentTestBase {
watchDeleteOrCreate.setAssertPeriod(1000);
watchDeleteOrCreate.assertIsSatisfied();
- watchModify.expectedMessageCount(0);
+ watchModify.expectedMessageCount(1);
watchModify.setAssertPeriod(1000);
watchModify.assertIsSatisfied();
- watchDelete.expectedMessageCount(0);
+ watchDelete.expectedMessageCount(1);
watchDelete.setAssertPeriod(1000);
watchDelete.assertIsSatisfied();