|
@@ -46,7 +46,7 @@ public class FileWatcherTest {
|
|
|
|
|
|
|
|
//@Test
|
|
//@Test
|
|
|
public void testFileWatch() throws InterruptedException, IOException {
|
|
public void testFileWatch() throws InterruptedException, IOException {
|
|
|
- FileWatcher watcher = new FileWatcher();
|
|
|
|
|
|
|
+ FileWatcher watcher = new FileWatcher(".logstash-forwarder-java");
|
|
|
watcher.addFilesToWatch("./test.txt", new Event().addField("test", "test"), FileWatcher.ONE_DAY);
|
|
watcher.addFilesToWatch("./test.txt", new Event().addField("test", "test"), FileWatcher.ONE_DAY);
|
|
|
for(int i = 0; i < 100; i++) {
|
|
for(int i = 0; i < 100; i++) {
|
|
|
Thread.sleep(1000);
|
|
Thread.sleep(1000);
|
|
@@ -60,7 +60,7 @@ public class FileWatcherTest {
|
|
|
logger.warn("Not executing this test on windows");
|
|
logger.warn("Not executing this test on windows");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- FileWatcher watcher = new FileWatcher();
|
|
|
|
|
|
|
+ FileWatcher watcher = new FileWatcher(".logstash-forwarder-java");
|
|
|
watcher.addFilesToWatch("./testFileWatcher*.txt", new Event().addField("test", "test"), FileWatcher.ONE_DAY);
|
|
watcher.addFilesToWatch("./testFileWatcher*.txt", new Event().addField("test", "test"), FileWatcher.ONE_DAY);
|
|
|
watcher.initialize();
|
|
watcher.initialize();
|
|
|
|
|
|