12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @requires vm.cds
27 * @summary test that --patch-module works with CDS
28 * @library /test/lib
29 * @modules java.base/jdk.internal.misc
30 * jdk.jartool/sun.tools.jar
31 * @build PatchModuleMain
32 * @run main PatchModuleCDS
33 */
34
35 import jdk.test.lib.compiler.InMemoryJavaCompiler;
36 import jdk.test.lib.process.OutputAnalyzer;
37 import jdk.test.lib.process.ProcessTools;
38
39 public class PatchModuleCDS {
40
41 public static void main(String args[]) throws Throwable {
42
43 // Case 1: Test that --patch-module and -Xshare:dump are compatible
44 String filename = "patch_module.jsa";
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
46 "-XX:+UnlockDiagnosticVMOptions",
47 "-XX:SharedArchiveFile=" + filename,
48 "-Xshare:dump",
49 "--patch-module=java.naming=no/such/directory",
50 "-Xlog:class+path=info",
51 "-version");
52 new OutputAnalyzer(pb.start())
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @requires vm.cds
27 * @summary test that --patch-module works with CDS
28 * @library /test/lib
29 * @modules java.base/jdk.internal.misc
30 * jdk.jartool/sun.tools.jar
31 * @build PatchModuleMain
32 * @run driver PatchModuleCDS
33 */
34
35 import jdk.test.lib.compiler.InMemoryJavaCompiler;
36 import jdk.test.lib.process.OutputAnalyzer;
37 import jdk.test.lib.process.ProcessTools;
38
39 public class PatchModuleCDS {
40
41 public static void main(String args[]) throws Throwable {
42
43 // Case 1: Test that --patch-module and -Xshare:dump are compatible
44 String filename = "patch_module.jsa";
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
46 "-XX:+UnlockDiagnosticVMOptions",
47 "-XX:SharedArchiveFile=" + filename,
48 "-Xshare:dump",
49 "--patch-module=java.naming=no/such/directory",
50 "-Xlog:class+path=info",
51 "-version");
52 new OutputAnalyzer(pb.start())
|