< prev index next >

test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java

Print this page




 155         TestCommon.run("-Xlog:class+load=trace",
 156                        "-cp", destJar.toString(),
 157                        "--patch-module", TEST_MODULE1 + "=" + MODS_DIR.toString(),
 158                        "--module-path", moduleDir.toString(),
 159                        "-m", TEST_MODULE1)
 160             .assertSilentlyDisabledCDS(out -> {
 161                 out.shouldHaveExitValue(0)
 162                    .shouldMatch("CDS is disabled when the.*option is specified")
 163                    .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
 164             });
 165         // modify the timestamp of the jar file
 166         (new File(destJar.toString())).setLastModified(System.currentTimeMillis() + 2000);
 167         // run with the archive and the jar with modified timestamp.
 168         // It should fail due to timestamp of the jar doesn't match the one
 169         // used during dump time.
 170         TestCommon.run("-Xlog:class+load=trace",
 171                        "-cp", destJar.toString(),
 172                        "--module-path", moduleDir.toString(),
 173                        "-m", TEST_MODULE1)
 174             .assertAbnormalExit(
 175                 "A jar/jimage file is not the one used while building the shared archive file:");
 176     }
 177 }


 155         TestCommon.run("-Xlog:class+load=trace",
 156                        "-cp", destJar.toString(),
 157                        "--patch-module", TEST_MODULE1 + "=" + MODS_DIR.toString(),
 158                        "--module-path", moduleDir.toString(),
 159                        "-m", TEST_MODULE1)
 160             .assertSilentlyDisabledCDS(out -> {
 161                 out.shouldHaveExitValue(0)
 162                    .shouldMatch("CDS is disabled when the.*option is specified")
 163                    .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
 164             });
 165         // modify the timestamp of the jar file
 166         (new File(destJar.toString())).setLastModified(System.currentTimeMillis() + 2000);
 167         // run with the archive and the jar with modified timestamp.
 168         // It should fail due to timestamp of the jar doesn't match the one
 169         // used during dump time.
 170         TestCommon.run("-Xlog:class+load=trace",
 171                        "-cp", destJar.toString(),
 172                        "--module-path", moduleDir.toString(),
 173                        "-m", TEST_MODULE1)
 174             .assertAbnormalExit(
 175                 "A jar file is not the one used while building the shared archive file:");
 176     }
 177 }
< prev index next >