Use temporary dir that can be fully deleted
package org.apache.commons.io.testtools;
import java.io.*;
+import static org.junit.Assert.fail;
/**
* Base class for testcases doing tests with files.
@SuppressWarnings("ResultOfMethodCallIgnored")
public static File getTestDirectory() {
if (testDir == null) {
- testDir = new File("test/io/").getAbsoluteFile();
+ testDir = new File("target/test_io/").getAbsoluteFile();
}
testDir.mkdirs();
+ if (!testDir.isDirectory()) {
+ fail("Could not create directory " + testDir);
+ }
return testDir;
}
