--- old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddModules.java 2018-04-06 15:40:41.804018133 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddModules.java 2018-04-06 15:40:41.519991349 -0700 @@ -107,29 +107,31 @@ "--module-path", moduleDir.toString(), "--add-modules", MAIN_MODULE1 + "," + MAIN_MODULE2); - TestCommon.checkExecReturn(output, 0, true, "Loading classes to share"); + TestCommon.checkDump(output); String prefix[] = {"-cp", "\"\"", "-Xlog:class+load=trace"}; // run the com.greetings module with the archive with the --module-path // the same as the one during dump time. // The classes should be loaded from the archive. - output = TestCommon.execModule(prefix, - null, // --upgrade-module-path - moduleDir.toString(), // --module-path - MAIN_MODULE1); // -m - TestCommon.checkExecReturn(output, 0, true, - "[class,load] com.greetings.Main source: shared objects file", - "[class,load] org.astro.World source: shared objects file"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + moduleDir.toString(), // --module-path + MAIN_MODULE1) // -m + .assertNormalExit(out -> { + out.shouldContain("[class,load] com.greetings.Main source: shared objects file") + .shouldContain("[class,load] org.astro.World source: shared objects file"); + }); // run the com.hello module with the archive with the --module-path // the same as the one during dump time. // The classes should be loaded from the archive. - output = TestCommon.execModule(prefix, - null, // --upgrade-module-path - moduleDir.toString(), // --module-path - MAIN_MODULE2); // -m - TestCommon.checkExecReturn(output, 0, true, - "[class,load] com.hello.Main source: shared objects file", - "[class,load] org.astro.World source: shared objects file"); + TestCommon.runWithModules(prefix, + null, // --upgrade-module-path + moduleDir.toString(), // --module-path + MAIN_MODULE2) // -m + .assertNormalExit(out -> { + out.shouldContain("[class,load] com.hello.Main source: shared objects file") + .shouldContain("[class,load] org.astro.World source: shared objects file"); + }); } }