diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/JunctionTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/JunctionTests.java index 3d3d5bd25f..f36c2a8914 100644 --- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/JunctionTests.java +++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/JunctionTests.java @@ -140,7 +140,11 @@ public void testEvent() throws Exception { final FileObject real2 = baseDir.resolveFile("weakref.txt"); real2.createFile(); - assertEquals("Weak Listener was abandoned", "Listener false true false", listener2.toString()); + try { + assertEquals("Weak Listener was abandoned", "Listener false true false", listener2.toString()); + } finally { + assertTrue("Don't contaminate the fs for the next time the test runs", file2.delete()); + } } /**