8194229: tools/jmod/JmodTest.jtr fails when no privilege to create sym link on windows
Reviewed-by: alanb
This commit is contained in:
parent
d586b03911
commit
dc5bb8b61b
@ -124,18 +124,21 @@ public class JImageExtractTest extends JImageCliTest {
|
||||
|
||||
public void testExtractToDirBySymlink() throws IOException {
|
||||
Path tmp = Files.createTempDirectory(Paths.get("."), getClass().getName());
|
||||
Path symlink;
|
||||
try {
|
||||
Path symlink = Files.createSymbolicLink(Paths.get(".", "symlink"), tmp);
|
||||
jimage("extract", "--dir", symlink.toString(), getImagePath())
|
||||
.assertSuccess()
|
||||
.resultChecker(r -> {
|
||||
assertTrue(r.output.isEmpty(), "Output is not expected");
|
||||
});
|
||||
verifyExplodedImage(tmp);
|
||||
} catch (UnsupportedOperationException e) {
|
||||
symlink = Files.createSymbolicLink(Paths.get(".", "symlink"), tmp);
|
||||
} catch (IOException|UnsupportedOperationException e) {
|
||||
// symlinks are not supported
|
||||
// nothing to test
|
||||
return;
|
||||
}
|
||||
|
||||
jimage("extract", "--dir", symlink.toString(), getImagePath())
|
||||
.assertSuccess()
|
||||
.resultChecker(r -> {
|
||||
assertTrue(r.output.isEmpty(), "Output is not expected");
|
||||
});
|
||||
verifyExplodedImage(tmp);
|
||||
}
|
||||
|
||||
public void testExtractToReadOnlyDir() throws IOException {
|
||||
|
@ -104,7 +104,7 @@ public class JmodTest {
|
||||
Path link = Files.createSymbolicLink(
|
||||
libDir.resolve("baz"), libDir.resolve("foo").toAbsolutePath());
|
||||
assertTrue(Files.exists(link));
|
||||
} catch (UnsupportedOperationException uoe) {
|
||||
} catch (IOException|UnsupportedOperationException uoe) {
|
||||
// OS does not support symlinks. Nothing to test!
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user