Skip to content
Permalink
Browse files

Merge pull request #220 from oleg-nenashev/tests/JENKINS-38696-remoti…

…ng-Util-mkdirs

[JENKINS-38696] - huson.remoting.UtilTest#mkdirs() should not try creating global paths on Windows.
  • Loading branch information...
oleg-nenashev committed Nov 15, 2017
2 parents 3813f30 + f238814 commit 40def984ff65bafcc3b595094567f47d9e6c9d15
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/test/java/hudson/remoting/UtilTest.java
@@ -161,13 +161,15 @@ public void mkdirs() throws IOException {
assertTrue(file.exists());
assertTrue(file.isFile());

// Fail to create aloud
try {
File forbidden = new File("/proc/nonono");
Util.mkdirs(forbidden);
fail();
} catch (IOException ex) {
// Expected
// Fail to create aloud, do not try on Windows
if (!Launcher.isWindows()) {
try {
File forbidden = new File("/proc/nonono");
Util.mkdirs(forbidden);
fail("The directory has been created when it should not: " + forbidden);
} catch (IOException ex) {
// Expected
}
}
}
}

0 comments on commit 40def98

Please sign in to comment.
You can’t perform that action at this time.