test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddReads.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddReads.java	Fri Apr  6 15:40:43 2018
--- new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddReads.java	Fri Apr  6 15:40:42 2018

*** 96,141 **** --- 96,143 ---- null, appClasses, "--module-path", moduleDir.toString(), "--add-modules", SUB_MODULE, "--add-reads", "com.norequires=org.astro", "-m", MAIN_MODULE); ! TestCommon.checkExecReturn(output, 0, true, "Loading classes to share"); ! TestCommon.checkDump(output); String prefix[] = {"-cp", "\"\"", "-Xlog:class+load=trace", "--add-modules", SUB_MODULE, "--add-reads", "com.norequires=org.astro"}; // run the com.norequires module with the archive with the same args // used during dump time. // The classes should be loaded from the archive. ! output = TestCommon.execModule(prefix, ! TestCommon.runWithModules(prefix, null, // --upgrade-module-path moduleDir.toString(), // --module-path ! MAIN_MODULE); // -m TestCommon.checkExecReturn(output, 0, true, "[class,load] com.norequires.Main source: shared objects file", ! "[class,load] org.astro.World source: shared objects file"); + .assertNormalExit(out -> { + out.shouldContain("[class,load] com.norequires.Main source: shared objects file") ! .shouldContain("[class,load] org.astro.World source: shared objects file"); + }); // create an archive with -cp pointing to the jar file containing the // org.astro module and --module-path pointing to the main module output = TestCommon.createArchive( subJar.toString(), appClasses, "--module-path", moduleDir.toString(), "--add-modules", SUB_MODULE, "--add-reads", "com.norequires=org.astro", "-m", MAIN_MODULE); ! TestCommon.checkExecReturn(output, 0, true, "Loading classes to share"); ! TestCommon.checkDump(output); // run the com.norequires module with the archive with the sub-module // in the -cp and with -add-reads=com.norequires=ALL-UNNAMED // The main class should be loaded from the archive. // The org.astro.World should be loaded from the jar. String prefix2[] = {"-cp", subJar.toString(), "-Xlog:class+load=trace", "--add-reads", "com.norequires=ALL-UNNAMED"}; ! output = TestCommon.execModule(prefix2, ! TestCommon.runWithModules(prefix2, null, // --upgrade-module-path moduleDir.toString(), // --module-path ! MAIN_MODULE); // -m TestCommon.checkExecReturn(output, 0, true, "[class,load] com.norequires.Main source: shared objects file"); ! output.shouldMatch(".class.load. org.astro.World source:.*org.astro.jar"); + .assertNormalExit(out -> { + out.shouldContain("[class,load] com.norequires.Main source: shared objects file") ! .shouldMatch(".class.load. org.astro.World source:.*org.astro.jar"); + }); } }

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