test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath

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

Print this page




 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 }


 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         // create an archive with a non-empty directory in the --module-path.
 177         // The dumping process will exit with an error due to non-empty directory
 178         // in the --module-path.
 179         output = TestCommon.createArchive(destJar.toString(), appClasses,
 180                                           "-Xlog:class+load=trace",
 181                                           "--module-path", MODS_DIR.toString(),
 182                                           "-m", TEST_MODULE1);
 183         output.shouldHaveExitValue(1)
 184               .shouldMatch("Error: non-empty directory.*com.simple");
 185     }
 186 }
test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File