Skip to content

Commit c17956b

Browse files
author
Niall Pemberton
committed
Fix FileSystemMonitorTestCase broken in refactoring
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1006079 13f79535-47bb-0310-9956-ffa450edef68
1 parent 624ad85 commit c17956b

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/test/java/org/apache/commons/io/monitor/AbstractMonitorTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public abstract class AbstractMonitorTestCase extends TestCase {
3535
protected FilesystemObserver observer;
3636

3737
/** Listener which collects file changes */
38-
protected CollectionFilesystemListener listener = new CollectionFilesystemListener(true);
38+
protected CollectionFilesystemListener listener;
3939

4040
/** Test diretory name */
4141
protected String testDirName = null;

src/test/java/org/apache/commons/io/monitor/FileSystemMonitorTestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public FileSystemMonitorTestCase(String name) {
3737
}
3838

3939
@Override
40-
protected void tearDown() throws Exception {
41-
FileUtils.deleteDirectory(testDir);
40+
protected void setUp() throws Exception {
41+
listener = new CollectionFilesystemListener(false);
42+
super.setUp();
4243
}
4344

4445
/**

src/test/java/org/apache/commons/io/monitor/FilesystemObserverTestCase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public FilesystemObserverTestCase(String name) {
3737
testDirName = "test-observer";
3838
}
3939

40+
@Override
41+
protected void setUp() throws Exception {
42+
listener = new CollectionFilesystemListener(true);
43+
super.setUp();
44+
}
45+
4046
/**
4147
* Test checkAndNotify() method
4248
*/

0 commit comments

Comments
 (0)