8177741: Fix hotspot tests to use --patch-module instead of -Xmodule
authorhseigel
Thu, 10 Aug 2017 11:12:13 -0400
changeset 46790 8c4deba6a0ee
parent 46788 fb479838027c
child 46791 e1b555ed3e50
8177741: Fix hotspot tests to use --patch-module instead of -Xmodule Summary: Change InMemoryJavaCompiler.compile() to accept --patch-module instead of -Xmodule, and then change appropriate tests. Reviewed-by: coleenp, gtriantafill
hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java
hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java
hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java
hotspot/test/runtime/modules/PatchModule/PatchModuleClassList.java
hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java
hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java
hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java
hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java
hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java
--- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -47,7 +47,7 @@
 
         ClassFileInstaller.writeClassToDisk("java/lang/Object",
                                         InMemoryJavaCompiler.compile("java.lang.Object", source,
-                                        "-Xmodule:java.base"),
+                                        "--patch-module=java.base"),
                                         "mods/java.base");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version");
--- a/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModule2Dirs.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -51,11 +51,11 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source1, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source1, "--patch-module=java.naming"),
              "mods/java.naming");
 
         ClassFileInstaller.writeClassToDisk("java/beans/Encoder",
-             InMemoryJavaCompiler.compile("java.beans.Encoder", source2, "-Xmodule:java.desktop"),
+             InMemoryJavaCompiler.compile("java.beans.Encoder", source2, "--patch-module=java.desktop"),
              "mods2/java.desktop");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleCDS.java	Thu Aug 10 11:12:13 2017 -0400
@@ -62,7 +62,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         pb = ProcessTools.createJavaProcessBuilder(
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleClassList.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleClassList.java	Thu Aug 10 11:12:13 2017 -0400
@@ -55,7 +55,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk(BOOT_CLASS,
-             InMemoryJavaCompiler.compile(BOOT_CLASS.replace('/', '.'), source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile(BOOT_CLASS.replace('/', '.'), source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         // Build the jar file that will be used for the module "java.naming".
@@ -88,7 +88,7 @@
                  "}";
 
         ClassFileInstaller.writeClassToDisk(PLATFORM_CLASS,
-             InMemoryJavaCompiler.compile(PLATFORM_CLASS.replace('/', '.'), source, "-Xmodule:java.transaction"),
+             InMemoryJavaCompiler.compile(PLATFORM_CLASS.replace('/', '.'), source, "--patch-module=java.transaction"),
              System.getProperty("test.classes"));
 
         // Build the jar file that will be used for the module "java.transaction".
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleJavaBase.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -46,7 +46,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("java/lang/NewClass",
-             InMemoryJavaCompiler.compile("java.lang.NewClass", source, "-Xmodule:java.base"),
+             InMemoryJavaCompiler.compile("java.lang.NewClass", source, "--patch-module=java.base"),
              "mods/java.base");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base",
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTest.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -46,7 +46,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"),
              "mods/java.naming");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming",
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJar.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -50,7 +50,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         // Build the jar file that will be used for the module "java.naming".
@@ -70,7 +70,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         // Supply --patch-module with the name of the jar file for the module java.naming.
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTestJarDir.java	Thu Aug 10 11:12:13 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -52,7 +52,7 @@
                         "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         // Build the jar file that will be used for the module "java.naming".
@@ -72,7 +72,7 @@
                  "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "--patch-module=java.naming"),
              System.getProperty("test.classes"));
 
         // Create a second class file in the module java.naming. This class file
@@ -85,7 +85,7 @@
                  "}";
 
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager2",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager2", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager2", source, "--patch-module=java.naming"),
              (System.getProperty("test.classes") + "/mods/java.naming"));
 
 
--- a/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java	Thu Aug 10 13:57:57 2017 +0200
+++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleTraceCL.java	Thu Aug 10 11:12:13 2017 -0400
@@ -48,7 +48,7 @@
 
         // Test -Xlog:class+load=info output for --patch-module
         ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
-             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
+             InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "--patch-module=java.naming"),
              "mods/java.naming");
 
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=mods/java.naming",