From 6837fa82a11af4d28802c7134364ef746195bbcd Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 14 Feb 2025 15:25:26 +0100 Subject: [PATCH] [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') --- .../apache/commons/vfs2/provider/test/JunctionTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); + } } /**