150 for (int i = 1; i <= 3; i++) {
151 System.out.println("========================================");
152 System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader +
153 ", useZGC: " + useZGC + ", ZGenerational: " + useZGenerational + ", case: " + i);
154 System.out.println("========================================");
155 String topArchiveName = getNewArchiveName();
156 String testCase = Integer.toString(i);
157 String cmdLine[] = new String[] {
158 "--add-modules",
159 "java.base,jdk.httpserver",
160 "--add-exports",
161 "java.base/jdk.internal.misc=ALL-UNNAMED",
162 "-Xlog:cds=debug,class+load,class+loader+constraints",
163 };
164
165 if (useCustomLoader) {
166 if (useZGC) {
167 String zGenerational = "-XX:" + (useZGenerational ? "+" : "-") + "ZGenerational";
168 // Add options to force eager class unloading.
169 cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
170 "-XX:+UseZGC", zGenerational, "-XX:ZCollectionInterval=0.01",
171 loaderMainClass, appJar);
172 setBaseArchiveOptions("-XX:+UseZGC", "-Xlog:cds");
173 } else {
174 cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
175 loaderMainClass, appJar);
176 }
177 } else {
178 cmdLine = TestCommon.concat(cmdLine, "-cp", appJar);
179 }
180
181 cmdLine = TestCommon.concat(cmdLine, mainClass, testCase);
182
183 String[] dumpCmdLine = cmdLine;
184 if (!errorInDump) {
185 dumpCmdLine = TestCommon.concat(dumpCmdLine, "loadClassOnly");
186 }
187
188 dump(topArchiveName, dumpCmdLine).assertNormalExit();
189 run(topArchiveName, cmdLine).assertNormalExit();
190 }
|
150 for (int i = 1; i <= 3; i++) {
151 System.out.println("========================================");
152 System.out.println("errorInDump: " + errorInDump + ", useCustomLoader: " + useCustomLoader +
153 ", useZGC: " + useZGC + ", ZGenerational: " + useZGenerational + ", case: " + i);
154 System.out.println("========================================");
155 String topArchiveName = getNewArchiveName();
156 String testCase = Integer.toString(i);
157 String cmdLine[] = new String[] {
158 "--add-modules",
159 "java.base,jdk.httpserver",
160 "--add-exports",
161 "java.base/jdk.internal.misc=ALL-UNNAMED",
162 "-Xlog:cds=debug,class+load,class+loader+constraints",
163 };
164
165 if (useCustomLoader) {
166 if (useZGC) {
167 String zGenerational = "-XX:" + (useZGenerational ? "+" : "-") + "ZGenerational";
168 // Add options to force eager class unloading.
169 cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
170 "-XX:+UseZGC", zGenerational, "-XX:ZCollectionInterval=0.01", "-XX:+UnlockExperimentalVMOptions", "-XX:-UseCompactObjectHeaders",
171 loaderMainClass, appJar);
172 setBaseArchiveOptions("-XX:+UseZGC", "-Xlog:cds");
173 } else {
174 cmdLine = TestCommon.concat(cmdLine, "-cp", loaderJar,
175 loaderMainClass, appJar);
176 }
177 } else {
178 cmdLine = TestCommon.concat(cmdLine, "-cp", appJar);
179 }
180
181 cmdLine = TestCommon.concat(cmdLine, mainClass, testCase);
182
183 String[] dumpCmdLine = cmdLine;
184 if (!errorInDump) {
185 dumpCmdLine = TestCommon.concat(dumpCmdLine, "loadClassOnly");
186 }
187
188 dump(topArchiveName, dumpCmdLine).assertNormalExit();
189 run(topArchiveName, cmdLine).assertNormalExit();
190 }
|