mirror of https://github.com/apache/druid.git
Improve test (#10480)
This commit is contained in:
parent
e9e7d82714
commit
0ab8b6e0a9
|
@ -103,12 +103,14 @@ public class FileUtilsTest
|
||||||
@Test
|
@Test
|
||||||
public void testCreateTempDirNonexistentBase()
|
public void testCreateTempDirNonexistentBase()
|
||||||
{
|
{
|
||||||
expectedException.expect(IllegalStateException.class);
|
|
||||||
expectedException.expectMessage("java.io.tmpdir (/nonexistent) does not exist");
|
|
||||||
|
|
||||||
final String oldJavaTmpDir = System.getProperty("java.io.tmpdir");
|
final String oldJavaTmpDir = System.getProperty("java.io.tmpdir");
|
||||||
|
final String nonExistentDir = oldJavaTmpDir + "/nonexistent";
|
||||||
|
|
||||||
|
expectedException.expect(IllegalStateException.class);
|
||||||
|
expectedException.expectMessage(StringUtils.format("java.io.tmpdir (%s) does not exist", nonExistentDir));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
System.setProperty("java.io.tmpdir", "/nonexistent");
|
System.setProperty("java.io.tmpdir", nonExistentDir);
|
||||||
FileUtils.createTempDir();
|
FileUtils.createTempDir();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
Loading…
Reference in New Issue