From 42ad9e31d928d519761bc8c458c06f912d13aabf Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 25 Jul 2011 19:06:33 +0000 Subject: [PATCH] added a testcase specifically for the modification time. --- .../org/wamblee/io/DirectoryMonitorTest.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/support/general/src/test/java/org/wamblee/io/DirectoryMonitorTest.java b/support/general/src/test/java/org/wamblee/io/DirectoryMonitorTest.java index b148fafe..1bb4d020 100644 --- a/support/general/src/test/java/org/wamblee/io/DirectoryMonitorTest.java +++ b/support/general/src/test/java/org/wamblee/io/DirectoryMonitorTest.java @@ -75,6 +75,19 @@ public class DirectoryMonitorTest extends TestCase { verifyNoMoreInteractions(listener); } + public void testFileModificationTimeChanged() throws InterruptedException { + data.createFile(FILE1, "hello"); + monitor.poll(); + reset(listener); + data.deleteFile(FILE1); + Thread.sleep(2000); + data.createFile(FILE1, "hello"); + + monitor.poll(); + verify(listener).fileChanged(data.getFile(FILE1)); + verifyNoMoreInteractions(listener); + } + public void testFileFilterIsUsed() { monitor.poll(); @@ -94,8 +107,8 @@ public class DirectoryMonitorTest extends TestCase { monitor.poll(); data.createFile(FILE1, "hello"); - stubVoid(listener).toThrow(new RuntimeException()).on().fileCreated( - data.getFile(FILE1)); + stubVoid(listener).toThrow(new RuntimeException()).on() + .fileCreated(data.getFile(FILE1)); try { monitor.poll(); -- 2.31.1