Skip to content

Commit 419ad3e

Browse files
committed
Use temporary dir that can be fully deleted
1 parent 31e1410 commit 419ad3e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/test/java/org/apache/commons/io/testtools/FileBasedTestCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.commons.io.testtools;
1818

1919
import java.io.*;
20+
import static org.junit.Assert.fail;
2021

2122
/**
2223
* Base class for testcases doing tests with files.
@@ -28,9 +29,12 @@ public abstract class FileBasedTestCase {
2829
@SuppressWarnings("ResultOfMethodCallIgnored")
2930
public static File getTestDirectory() {
3031
if (testDir == null) {
31-
testDir = new File("test/io/").getAbsoluteFile();
32+
testDir = new File("target/test_io/").getAbsoluteFile();
3233
}
3334
testDir.mkdirs();
35+
if (!testDir.isDirectory()) {
36+
fail("Could not create directory " + testDir);
37+
}
3438
return testDir;
3539
}
3640

0 commit comments

Comments
 (0)