This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 6837fa82a [VFS-856] fix JunctionTests (#663)
6837fa82a is described below

commit 6837fa82a11af4d28802c7134364ef746195bbcd
Author: Arnout Engelen <[email protected]>
AuthorDate: Fri Feb 14 15:25:26 2025 +0100

    [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')
---
 .../java/org/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 3d3d5bd25..f36c2a891 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 class JunctionTests extends 
AbstractProviderTestCase {
 
         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());
+        }
     }
 
     /**

Reply via email to