changeset 57430:d94a119b4413

8214916: SourceLauncherTest fails on exploded image Reviewed-by: ksrini
author jjg
date Wed, 11 Dec 2019 15:33:17 -0800
parents 8086ccbe445d
children dda082a3bd93
files test/langtools/tools/javac/launcher/SourceLauncherTest.java test/langtools/tools/javac/plugin/AutostartPlugins.java
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/launcher/SourceLauncherTest.java	Wed Dec 11 11:55:50 2019 -0800
+++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java	Wed Dec 11 15:33:17 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,6 +213,12 @@
 
     @Test
     public void testPermissions(Path base) throws IOException {
+        // does not work on exploded image, because the default policy file assumes jrt:; skip the test
+        if (Files.exists(Path.of(System.getProperty("java.home")).resolve("modules"))) {
+            out.println("JDK using exploded modules; test skipped");
+            return;
+        }
+
         Path policyFile = base.resolve("test.policy");
         Path sourceFile = base.resolve("TestPermissions.java");
 
--- a/test/langtools/tools/javac/plugin/AutostartPlugins.java	Wed Dec 11 11:55:50 2019 -0800
+++ b/test/langtools/tools/javac/plugin/AutostartPlugins.java	Wed Dec 11 15:33:17 2019 -0800
@@ -141,6 +141,12 @@
 
     @Test
     public void testImage(Path base) throws Exception {
+        // does not work on exploded image: cannot jlink an image from exploded modules; skip the test
+        if (Files.exists(Path.of(System.getProperty("java.home")).resolve("modules"))) {
+            out.println("JDK using exploded modules; test skipped");
+            return;
+        }
+
         Path tmpJDK = base.resolve("tmpJDK");
         ToolProvider jlink = ToolProvider.findFirst("jlink")
                 .orElseThrow(() -> new Exception("cannot find jlink"));