Properly handle the case where symlinks are supported, but

the user is not a windows administrator (can throw IOE in this case)
This commit is contained in:
Robert Muir 2015-05-12 00:53:51 -04:00
parent 019a9410a3
commit d1defef69d
1 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ public class SecurityTests extends ElasticsearchTestCase {
Path linkExists = p.resolve("linkExists"); Path linkExists = p.resolve("linkExists");
try { try {
Files.createSymbolicLink(linkExists, exists); Files.createSymbolicLink(linkExists, exists);
} catch (UnsupportedOperationException e) { } catch (UnsupportedOperationException | IOException e) {
assumeNoException("test requires filesystem that supports symbolic links", e); assumeNoException("test requires filesystem that supports symbolic links", e);
} }
Security.ensureDirectoryExists(linkExists); Security.ensureDirectoryExists(linkExists);
@ -168,7 +168,7 @@ public class SecurityTests extends ElasticsearchTestCase {
Path brokenLink = p.resolve("brokenLink"); Path brokenLink = p.resolve("brokenLink");
try { try {
Files.createSymbolicLink(brokenLink, p.resolve("nonexistent")); Files.createSymbolicLink(brokenLink, p.resolve("nonexistent"));
} catch (UnsupportedOperationException e) { } catch (UnsupportedOperationException | IOException e) {
assumeNoException("test requires filesystem that supports symbolic links", e); assumeNoException("test requires filesystem that supports symbolic links", e);
} }
try { try {