Skip to content

Commit 6837fa8

Browse files
authored
[VFS-856] fix JunctionTests (#663)
The test would leave a file behind, causing it to fail the next time it runs (e.g. impacting 'mvn install')
1 parent 05f6b35 commit 6837fa8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/JunctionTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ public void testEvent() throws Exception {
140140

141141
final FileObject real2 = baseDir.resolveFile("weakref.txt");
142142
real2.createFile();
143-
assertEquals("Weak Listener was abandoned", "Listener false true false", listener2.toString());
143+
try {
144+
assertEquals("Weak Listener was abandoned", "Listener false true false", listener2.toString());
145+
} finally {
146+
assertTrue("Don't contaminate the fs for the next time the test runs", file2.delete());
147+
}
144148
}
145149

146150
/**

0 commit comments

Comments
 (0)