author | iklam |
Fri, 09 Aug 2019 13:13:36 -0700 | |
changeset 57705 | 7cf02b2c1455 |
parent 57567 | b000362a89a0 |
child 58679 | 9c3209ff7550 |
permissions | -rw-r--r-- |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
1 |
/* |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
51990
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
4 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
8 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
13 |
* accompanied this code). |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
14 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
18 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
21 |
* questions. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
22 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
23 |
*/ |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
24 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
25 |
/* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
26 |
* @test |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
27 |
* @summary Test archived system module sub-graph and verify objects are archived. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
28 |
* @requires vm.cds.archived.java.heap |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
51990
diff
changeset
|
29 |
* @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
30 |
* @build sun.hotspot.WhiteBox |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
31 |
* @compile CheckArchivedModuleApp.java |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
32 |
* @run driver ClassFileInstaller -jar app.jar CheckArchivedModuleApp |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
33 |
* @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox |
51990
6003e034cdd8
8209946: [TESTBUG] CDS tests should use "@run driver"
iklam
parents:
51371
diff
changeset
|
34 |
* @run driver ArchivedModuleComboTest |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
35 |
*/ |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
36 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
37 |
import java.io.File; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
38 |
import java.nio.file.Files; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
39 |
import java.nio.file.Path; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
40 |
import java.nio.file.Paths; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
41 |
import jdk.test.lib.process.OutputAnalyzer; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
42 |
import jdk.test.lib.process.ProcessTools; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
43 |
import sun.hotspot.WhiteBox; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
44 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
45 |
public class ArchivedModuleComboTest { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
46 |
public static void main(String[] args) throws Exception { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
47 |
String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
48 |
String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
49 |
String appJar = ClassFileInstaller.getJarPath("app.jar"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
50 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
51 |
Path userDir = Paths.get(System.getProperty("user.dir")); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
52 |
Path moduleDir = Files.createTempDirectory(userDir, "mods"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
53 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
54 |
// |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
55 |
// Dump without --module-path, without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
56 |
// |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
57 |
OutputAnalyzer output = TestCommon.dump(appJar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
58 |
TestCommon.list("CheckArchivedModuleApp"), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
59 |
use_whitebox_jar); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
60 |
TestCommon.checkDump(output); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
61 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
62 |
// Test case 1) |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
63 |
// - Dump without --module-path, without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
64 |
// - Run from -cp only and without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
65 |
// + archived boot layer module ModuleDescriptors should be used |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
66 |
// + archived boot layer configuration should be used |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
67 |
System.out.println("----------------------- Test case 1 ----------------------"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
68 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
69 |
"-XX:+UnlockDiagnosticVMOptions", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
70 |
"-XX:+WhiteBoxAPI", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
71 |
"CheckArchivedModuleApp", |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
72 |
"yes", |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
73 |
"yes"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
74 |
TestCommon.checkExec(output); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
75 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
76 |
// Test case 2) |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
77 |
// - Dump without --module-path, without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
78 |
// - Run from -cp only and with --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
79 |
// + archived boot layer module ModuleDescriptors should be used with |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
80 |
// --show-module-resolution (requires resolution) |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
81 |
// + archived boot layer Configuration should not be disabled |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
82 |
System.out.println("----------------------- Test case 2 ----------------------"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
83 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
84 |
"--show-module-resolution", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
85 |
"-XX:+UnlockDiagnosticVMOptions", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
86 |
"-XX:+WhiteBoxAPI", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
87 |
"CheckArchivedModuleApp", |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
88 |
"yes", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
89 |
"no"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
90 |
TestCommon.checkExec(output, "root java.base jrt:/java.base"); |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
91 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
92 |
// Test case 3) |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
93 |
// - Dump without --module-path, without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
94 |
// - Run with --module-path |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
95 |
// + archived boot layer module ModuleDescriptors should be disabled |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
96 |
// + archived boot layer Configuration should be disabled |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
97 |
System.out.println("----------------------- Test case 3 ----------------------"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
98 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
99 |
"--module-path", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
100 |
moduleDir.toString(), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
101 |
"-XX:+UnlockDiagnosticVMOptions", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
102 |
"-XX:+WhiteBoxAPI", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
103 |
"CheckArchivedModuleApp", |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
104 |
"no", |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
105 |
"no"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
106 |
TestCommon.checkExec(output); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
107 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
108 |
// |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
109 |
// Dump with --module-path specified (test case 4, 5). Use an |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
110 |
// empty directory as it's simple and still triggers the case |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
111 |
// where system module objects are not archived. |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
112 |
// |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
113 |
output = TestCommon.dump(appJar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
114 |
TestCommon.list("CheckArchivedModuleApp"), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
115 |
"--module-path", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
116 |
moduleDir.toString(), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
117 |
use_whitebox_jar); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
118 |
TestCommon.checkDump(output); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
119 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
120 |
// Test case 4) |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
121 |
// - Dump with --module-path |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
122 |
// - Run from -cp only, no archived boot layer module ModuleDescriptors |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
123 |
// and Configuration should be found. |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
124 |
System.out.println("----------------------- Test case 4 ----------------------"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
125 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
126 |
"-XX:+UnlockDiagnosticVMOptions", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
127 |
"-XX:+WhiteBoxAPI", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
128 |
"CheckArchivedModuleApp", |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
129 |
"no", |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
130 |
"no"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
131 |
TestCommon.checkExec(output); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
132 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
133 |
// Test case 5) |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
134 |
// - Dump with --module-path |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
135 |
// - Run with --module-path, no archived boot layer module ModuleDescriptors |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
136 |
// and Configuration should be found. |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
137 |
System.out.println("----------------------- Test case 5 ----------------------"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
138 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
139 |
"--module-path", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
140 |
moduleDir.toString(), |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
141 |
"-XX:+UnlockDiagnosticVMOptions", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
142 |
"-XX:+WhiteBoxAPI", |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
143 |
"CheckArchivedModuleApp", |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
144 |
"no", |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
145 |
"no"); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
146 |
TestCommon.checkExec(output); |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
147 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
148 |
// |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
149 |
// Dump without --module-path, with --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
150 |
// |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
151 |
output = TestCommon.dump(appJar, |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
152 |
TestCommon.list("CheckArchivedModuleApp"), |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
153 |
"--show-module-resolution", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
154 |
use_whitebox_jar); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
155 |
TestCommon.checkDump(output, "root java.base jrt:/java.base"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
156 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
157 |
// Test case 6) |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
158 |
// - Dump without --module-path, with --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
159 |
// - Run from -cp only and without --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
160 |
// + archived boot layer module ModuleDescriptors should be used |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
161 |
// + archived boot layer Configuration should be used |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
162 |
System.out.println("----------------------- Test case 6 ----------------------"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
163 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
164 |
"-XX:+UnlockDiagnosticVMOptions", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
165 |
"-XX:+WhiteBoxAPI", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
166 |
"CheckArchivedModuleApp", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
167 |
"yes", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
168 |
"yes"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
169 |
TestCommon.checkExec(output); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
170 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
171 |
// Test case 7) |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
172 |
// - Dump without --module-path, with --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
173 |
// - Run from -cp only and with --show-module-resolution |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
174 |
// + archived boot layer module ModuleDescriptors should be used with |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
175 |
// --show-module-resolution (requires resolution) |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
176 |
// + archived boot layer Configuration should be disabled |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
177 |
System.out.println("----------------------- Test case 7 ----------------------"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
178 |
output = TestCommon.exec(appJar, use_whitebox_jar, |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
179 |
"--show-module-resolution", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
180 |
"-XX:+UnlockDiagnosticVMOptions", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
181 |
"-XX:+WhiteBoxAPI", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
182 |
"CheckArchivedModuleApp", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
183 |
"yes", |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
184 |
"no"); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
185 |
TestCommon.checkExec(output, "root java.base jrt:/java.base"); |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
186 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
187 |
} |