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

test/hotspot/jtreg/runtime/appcds/VerifierTest.java

Print this page

        

*** 44,53 **** --- 44,55 ---- "ERROR: class VerifierTestC was loaded unexpectedly"; static final String MAP_FAIL = "shared archive file was created with less restrictive verification setting"; static final String VFY_ERR = "java.lang.VerifyError"; static final String PASS_RESULT = "Hi, how are you?"; + static final String VFY_INFO_MESSAGE = + "All non-system classes will be verified (-Xverify:remote) during CDS dump time."; enum Testset1Part { A, B }
*** 135,145 **** // Dump app/ext with -Xverify:all {"app", VFY_ALL, VFY_REMOTE, VFY_ERR }, {"app", VFY_ALL, VFY_ALL, VFY_ERR }, {"app", VFY_ALL, VFY_NONE, ERR }, // Dump app/ext with -Xverify:none ! {"app", VFY_NONE, VFY_REMOTE, MAP_FAIL}, {"app", VFY_NONE, VFY_ALL, MAP_FAIL}, {"app", VFY_NONE, VFY_NONE, ERR }, // Dump sys only with -Xverify:remote {"noApp", VFY_REMOTE, VFY_REMOTE, VFY_ERR}, {"noApp", VFY_REMOTE, VFY_ALL, VFY_ERR}, --- 137,147 ---- // Dump app/ext with -Xverify:all {"app", VFY_ALL, VFY_REMOTE, VFY_ERR }, {"app", VFY_ALL, VFY_ALL, VFY_ERR }, {"app", VFY_ALL, VFY_NONE, ERR }, // Dump app/ext with -Xverify:none ! {"app", VFY_NONE, VFY_REMOTE, VFY_ERR}, {"app", VFY_NONE, VFY_ALL, MAP_FAIL}, {"app", VFY_NONE, VFY_NONE, ERR }, // Dump sys only with -Xverify:remote {"noApp", VFY_REMOTE, VFY_REMOTE, VFY_ERR}, {"noApp", VFY_REMOTE, VFY_ALL, VFY_ERR},
*** 186,195 **** --- 188,201 ---- jar, dump_list, dump_setting, // FIXME: the following options are for working around a GC // issue - assert failure when dumping archive with the -Xverify:all "-Xms256m", "-Xmx256m"); + if (dump_setting.equals(VFY_NONE) && + runtime_setting.equals(VFY_REMOTE)) { + dumpOutput.shouldContain(VFY_INFO_MESSAGE); + } } TestCommon.run("-cp", jar, runtime_setting, "VerifierTest0") .ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str));
*** 219,251 **** // Dump app/ext with -Xverify:all {"app", VFY_ALL, VFY_REMOTE, PASS_RESULT }, {"app", VFY_ALL, VFY_ALL, PASS_RESULT }, {"app", VFY_ALL, VFY_NONE, PASS_RESULT }, // Dump app/ext with -Xverify:none ! {"app", VFY_NONE, VFY_REMOTE, MAP_FAIL}, {"app", VFY_NONE, VFY_ALL, MAP_FAIL}, {"app", VFY_NONE, VFY_NONE, PASS_RESULT }, }; for (int i = 0; i < config2.length; i ++) { // config2[i][0] is always set to "app" in this test String dump_setting = config2[i][1]; String runtime_setting = config2[i][2]; String expected_output_str = config2[i][3]; System.out.println("Test case [" + i + "]: dumping " + config2[i][0] + " with " + dump_setting + ", run with " + runtime_setting); OutputAnalyzer dumpOutput = TestCommon.dump( jar, appClasses, dump_setting, "-XX:+UnlockDiagnosticVMOptions", // FIXME: the following options are for working around a GC // issue - assert failure when dumping archive with the -Xverify:all "-Xms256m", "-Xmx256m"); TestCommon.run("-cp", jar, runtime_setting, "Hi") .ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str)); } } static void createTestJarFile(File jarSrcFile, File jarFile) throws Exception { jarFile.delete(); --- 225,265 ---- // Dump app/ext with -Xverify:all {"app", VFY_ALL, VFY_REMOTE, PASS_RESULT }, {"app", VFY_ALL, VFY_ALL, PASS_RESULT }, {"app", VFY_ALL, VFY_NONE, PASS_RESULT }, // Dump app/ext with -Xverify:none ! {"app", VFY_NONE, VFY_REMOTE, PASS_RESULT}, {"app", VFY_NONE, VFY_ALL, MAP_FAIL}, {"app", VFY_NONE, VFY_NONE, PASS_RESULT }, }; + String prev_dump_setting = ""; for (int i = 0; i < config2.length; i ++) { // config2[i][0] is always set to "app" in this test String dump_setting = config2[i][1]; String runtime_setting = config2[i][2]; String expected_output_str = config2[i][3]; System.out.println("Test case [" + i + "]: dumping " + config2[i][0] + " with " + dump_setting + ", run with " + runtime_setting); + if (!dump_setting.equals(prev_dump_setting)) { OutputAnalyzer dumpOutput = TestCommon.dump( jar, appClasses, dump_setting, "-XX:+UnlockDiagnosticVMOptions", // FIXME: the following options are for working around a GC // issue - assert failure when dumping archive with the -Xverify:all "-Xms256m", "-Xmx256m"); + if (dump_setting.equals(VFY_NONE) && + runtime_setting.equals(VFY_REMOTE)) { + dumpOutput.shouldContain(VFY_INFO_MESSAGE); + } + } TestCommon.run("-cp", jar, runtime_setting, "Hi") .ifNoMappingFailure(output -> checkRuntimeOutput(output, expected_output_str)); + prev_dump_setting = dump_setting; } } static void createTestJarFile(File jarSrcFile, File jarFile) throws Exception { jarFile.delete();
test/hotspot/jtreg/runtime/appcds/VerifierTest.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File