changeset 54114:d295a7d2b933

8220634: SymLinkArchiveTest should handle not being able to create symlinks Reviewed-by: jjg
author cushon
date Wed, 13 Mar 2019 17:26:21 -0700
parents f7a745888a1e
children 17bf38efed0e
files test/langtools/tools/javac/file/SymLinkArchiveTest.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/file/SymLinkArchiveTest.java	Thu Mar 14 04:10:10 2019 +0100
+++ b/test/langtools/tools/javac/file/SymLinkArchiveTest.java	Wed Mar 13 17:26:21 2019 -0700
@@ -33,6 +33,7 @@
  * @run main SymLinkArchiveTest
  */
 
+import java.nio.file.FileSystemException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -69,7 +70,13 @@
         tb.writeFile(javaFile, "class T extends p.B {}");
 
         Path jar = base.resolve("lib.jar");
-        Files.createSymbolicLink(jar, classpath.getFileName());
+        try {
+            Files.createSymbolicLink(jar, classpath.getFileName());
+        } catch (FileSystemException fse) {
+            System.err.println("warning: test passes vacuously, sym-link could not be created");
+            System.err.println(fse.getMessage());
+            return;
+        }
 
         Result result = new JavacTask(tb).files(javaFile).classpath(jar).run(Expect.FAIL);
         String output = result.getOutput(OutputKind.DIRECT);