From: erik Date: Mon, 25 Jul 2011 19:06:33 +0000 (+0000) Subject: added a testcase specifically for the modification time. X-Git-Tag: BEFORE_SVN_TO_GIT~2 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=42ad9e31d928d519761bc8c458c06f912d13aabf;p=utils added a testcase specifically for the modification time. --- 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();