test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java
changeset 59236 e2ee246e44e3
parent 57705 7cf02b2c1455
equal deleted inserted replaced
59235:0f41ac6bb9dd 59236:e2ee246e44e3
    47                         TestCommon.list("PrintSystemModulesApp"));
    47                         TestCommon.list("PrintSystemModulesApp"));
    48         TestCommon.checkDump(output);
    48         TestCommon.checkDump(output);
    49 
    49 
    50         output = TestCommon.execOff("-cp", appJar, "PrintSystemModulesApp");
    50         output = TestCommon.execOff("-cp", appJar, "PrintSystemModulesApp");
    51         output.shouldHaveExitValue(0);
    51         output.shouldHaveExitValue(0);
    52         String bootModules1 = output.getStdout();
    52         String bootModules1 = TestCommon.filterOutLogs(output.getStdout());
    53 
    53 
    54         output = TestCommon.exec(appJar, "PrintSystemModulesApp");
    54         output = TestCommon.exec(appJar, "PrintSystemModulesApp");
    55         TestCommon.checkExec(output);
    55         TestCommon.checkExec(output);
    56         if (output.getStderr().contains("sharing")) {
    56         if (output.getStderr().contains("sharing")) {
    57             String bootModules2 = output.getStdout();
    57             String bootModules2 = TestCommon.filterOutLogs(output.getStdout());
    58             TestCommon.checkOutputStrings(bootModules1, bootModules2, ", ");
    58             TestCommon.checkOutputStrings(bootModules1, bootModules2, ", ");
    59         }
    59         }
    60 
    60 
    61         // Test case 2)
    61         // Test case 2)
    62         // Verify --show-module-resolution output with the output from
    62         // Verify --show-module-resolution output with the output from
    64         System.out.println("---------------- Test case 2 -----------------");
    64         System.out.println("---------------- Test case 2 -----------------");
    65         output = TestCommon.execOff("-cp", appJar,
    65         output = TestCommon.execOff("-cp", appJar,
    66                                     "--show-module-resolution",
    66                                     "--show-module-resolution",
    67                                     "-version");
    67                                     "-version");
    68         output.shouldHaveExitValue(0);
    68         output.shouldHaveExitValue(0);
    69         String moduleResolutionOut1 = output.getStdout();
    69         String moduleResolutionOut1 = TestCommon.filterOutLogs(output.getStdout());
    70 
    70 
    71         output = TestCommon.exec(appJar,
    71         output = TestCommon.exec(appJar,
    72                                  "--show-module-resolution",
    72                                  "--show-module-resolution",
    73                                  "-version");
    73                                  "-version");
    74         TestCommon.checkExec(output);
    74         TestCommon.checkExec(output);
    75         if (output.getStderr().contains("sharing")) {
    75         if (output.getStderr().contains("sharing")) {
    76             String moduleResolutionOut2 = output.getStdout();
    76             String moduleResolutionOut2 = TestCommon.filterOutLogs(output.getStdout());
    77             TestCommon.checkOutputStrings(
    77             TestCommon.checkOutputStrings(
    78                 moduleResolutionOut1, moduleResolutionOut2, "\n");
    78                 moduleResolutionOut1, moduleResolutionOut2, "\n");
    79         }
    79         }
    80     }
    80     }
    81 }
    81 }