226 {"app", VFY_ALL, VFY_REMOTE, PASS_RESULT },
227 {"app", VFY_ALL, VFY_ALL, PASS_RESULT },
228 {"app", VFY_ALL, VFY_NONE, PASS_RESULT },
229 // Dump app/ext with -Xverify:none
230 {"app", VFY_NONE, VFY_REMOTE, PASS_RESULT},
231 {"app", VFY_NONE, VFY_ALL, MAP_FAIL},
232 {"app", VFY_NONE, VFY_NONE, PASS_RESULT },
233 };
234 String prev_dump_setting = "";
235 for (int i = 0; i < config2.length; i ++) {
236 // config2[i][0] is always set to "app" in this test
237 String dump_setting = config2[i][1];
238 String runtime_setting = config2[i][2];
239 String expected_output_str = config2[i][3];
240 System.out.println("Test case [" + i + "]: dumping " + config2[i][0] +
241 " with " + dump_setting +
242 ", run with " + runtime_setting);
243 if (!dump_setting.equals(prev_dump_setting)) {
244 OutputAnalyzer dumpOutput = TestCommon.dump(
245 jar, appClasses, dump_setting,
246 "-XX:+UnlockDiagnosticVMOptions",
247 // FIXME: the following options are for working around a GC
248 // issue - assert failure when dumping archive with the -Xverify:all
249 "-Xms256m",
250 "-Xmx256m");
251 if (dump_setting.equals(VFY_NONE) &&
252 runtime_setting.equals(VFY_REMOTE)) {
253 dumpOutput.shouldContain(VFY_INFO_MESSAGE);
254 }
255 }
256 TestCommon.run("-cp", jar,
257 runtime_setting,
258 "Hi")
259 .ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str));
260 prev_dump_setting = dump_setting;
261 }
262 }
263
264 static void createTestJarFile(File jarSrcFile, File jarFile) throws Exception {
265 jarFile.delete();
266 Files.copy(jarSrcFile.toPath(), jarFile.toPath());
|
226 {"app", VFY_ALL, VFY_REMOTE, PASS_RESULT },
227 {"app", VFY_ALL, VFY_ALL, PASS_RESULT },
228 {"app", VFY_ALL, VFY_NONE, PASS_RESULT },
229 // Dump app/ext with -Xverify:none
230 {"app", VFY_NONE, VFY_REMOTE, PASS_RESULT},
231 {"app", VFY_NONE, VFY_ALL, MAP_FAIL},
232 {"app", VFY_NONE, VFY_NONE, PASS_RESULT },
233 };
234 String prev_dump_setting = "";
235 for (int i = 0; i < config2.length; i ++) {
236 // config2[i][0] is always set to "app" in this test
237 String dump_setting = config2[i][1];
238 String runtime_setting = config2[i][2];
239 String expected_output_str = config2[i][3];
240 System.out.println("Test case [" + i + "]: dumping " + config2[i][0] +
241 " with " + dump_setting +
242 ", run with " + runtime_setting);
243 if (!dump_setting.equals(prev_dump_setting)) {
244 OutputAnalyzer dumpOutput = TestCommon.dump(
245 jar, appClasses, dump_setting,
246 // FIXME: the following options are for working around a GC
247 // issue - assert failure when dumping archive with the -Xverify:all
248 "-Xms256m",
249 "-Xmx256m");
250 if (dump_setting.equals(VFY_NONE) &&
251 runtime_setting.equals(VFY_REMOTE)) {
252 dumpOutput.shouldContain(VFY_INFO_MESSAGE);
253 }
254 }
255 TestCommon.run("-cp", jar,
256 runtime_setting,
257 "Hi")
258 .ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str));
259 prev_dump_setting = dump_setting;
260 }
261 }
262
263 static void createTestJarFile(File jarSrcFile, File jarFile) throws Exception {
264 jarFile.delete();
265 Files.copy(jarSrcFile.toPath(), jarFile.toPath());
|