test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Cdiff test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java

test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java

Print this page

        

*** 1,7 **** /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2015, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 48,58 **** "-Xshare:dump", "--patch-module=java.naming=no/such/directory", "-Xlog:class+path=info", "-version"); new OutputAnalyzer(pb.start()) ! .shouldContain("ro space:"); // Make sure archive got created. // Case 2: Test that directory in --patch-module is supported for CDS dumping // Create a class file in the module java.base. String source = "package javax.naming.spi; " + "public class NamingManager { " + --- 48,59 ---- "-Xshare:dump", "--patch-module=java.naming=no/such/directory", "-Xlog:class+path=info", "-version"); new OutputAnalyzer(pb.start()) ! // --patch-module is not supported during CDS dumping ! .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); // Case 2: Test that directory in --patch-module is supported for CDS dumping // Create a class file in the module java.base. String source = "package javax.naming.spi; " + "public class NamingManager { " +
*** 71,81 **** "-Xshare:dump", "--patch-module=java.naming=" + System.getProperty("test.classes"), "-Xlog:class+path=info", "-version"); new OutputAnalyzer(pb.start()) ! .shouldContain("ro space:"); // Make sure archive got created. // Case 3a: Test CDS dumping with jar file in --patch-module BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager"); String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); pb = ProcessTools.createJavaProcessBuilder( --- 72,83 ---- "-Xshare:dump", "--patch-module=java.naming=" + System.getProperty("test.classes"), "-Xlog:class+path=info", "-version"); new OutputAnalyzer(pb.start()) ! // --patch-module is not supported during CDS dumping ! .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); // Case 3a: Test CDS dumping with jar file in --patch-module BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager"); String moduleJar = BasicJarBuilder.getTestJar("javanaming.jar"); pb = ProcessTools.createJavaProcessBuilder(
*** 85,95 **** "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", "-Xlog:class+path=info", "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) ! .shouldContain("ro space:"); // Make sure archive got created. // Case 3b: Test CDS run with jar file in --patch-module pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, --- 87,98 ---- "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", "-Xlog:class+path=info", "PatchModuleMain", "javax.naming.spi.NamingManager"); new OutputAnalyzer(pb.start()) ! // --patch-module is not supported during CDS dumping ! .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module"); // Case 3b: Test CDS run with jar file in --patch-module pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename,
test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File