fix TempFilesTest
authorNiki Roo <niki@nikiroo.be>
Sun, 24 Feb 2019 09:52:44 +0000 (10:52 +0100)
committerNiki Roo <niki@nikiroo.be>
Sun, 24 Feb 2019 09:52:44 +0000 (10:52 +0100)
src/be/nikiroo/utils/test/TempFilesTest.java

index 905ca4d83266c4727a56e97b02a2495f1a0e3290..460d396edfde962f5de5861c6d61bf80ca774c6d 100644 (file)
@@ -86,12 +86,22 @@ class TempFilesTest extends TestLauncher {
        }
 
        private class RootTempFiles extends TempFiles {
+               private File root = null;
+
                public RootTempFiles(String name) throws IOException {
                        super(name);
                }
 
                public File getRoot() {
-                       return root;
+                       if (root != null)
+                               return root;
+                       return super.root;
+               }
+
+               @Override
+               public synchronized void close() throws IOException {
+                       root = super.root;
+                       super.close();
                }
        }
 }