115 .assertNormalExit(out -> {
116 out.shouldContain("[class,load] com.greetings.Main source: shared objects file")
117 .shouldContain("[class,load] org.astro.World source: shared objects file");
118 });
119
120 // run with the archive with the --module-path different from the one during
121 // dump time. The classes should be loaded from the jar files.
122 TestCommon.runWithModules(prefix,
123 null, // --upgrade-module-path
124 moduleDir2.toString(), // --module-path
125 MAIN_MODULE) // -m
126 .assertNormalExit(out -> {
127 out.shouldMatch(".class.load. com.greetings.Main source:.*com.greetings.jar")
128 .shouldMatch(".class.load. org.astro.World source:.*org.astro.jar");
129 });
130
131 // create an archive with modular jar files in both -cp and --module-path
132 String jars = subJar.toString() + System.getProperty("path.separator") +
133 mainJar.toString();
134 output = TestCommon.createArchive( jars, appClasses,
135 "-Xlog:class+load=trace", "-XX:+PrintSystemDictionaryAtExit",
136 "--module-path", moduleDir.toString(),
137 "-m", MAIN_MODULE);
138 TestCommon.checkDump(output);
139
140 // run with archive with the main class name specified before
141 // the module name with the -m option. Since the -m option was specified
142 // during dump time, the classes in the jar files after the -cp won't be
143 // archived. Therefore, the classes won't be loaded from the archive but
144 // will be loaded from the jar files.
145 TestCommon.run("-Xlog:class+load=trace",
146 "-cp", jars,
147 "--module-path", moduleDir.toString(),
148 MAIN_CLASS, "-m", MAIN_MODULE)
149 .assertNormalExit(out -> {
150 out.shouldMatch(".class.load. com.greetings.Main source:.*com.greetings.jar")
151 .shouldMatch(".class.load. org.astro.World source:.*org.astro.jar");
152 });
153
154 // similar to the above case but without the main class name. The classes
155 // should be loaded from the archive.
|
115 .assertNormalExit(out -> {
116 out.shouldContain("[class,load] com.greetings.Main source: shared objects file")
117 .shouldContain("[class,load] org.astro.World source: shared objects file");
118 });
119
120 // run with the archive with the --module-path different from the one during
121 // dump time. The classes should be loaded from the jar files.
122 TestCommon.runWithModules(prefix,
123 null, // --upgrade-module-path
124 moduleDir2.toString(), // --module-path
125 MAIN_MODULE) // -m
126 .assertNormalExit(out -> {
127 out.shouldMatch(".class.load. com.greetings.Main source:.*com.greetings.jar")
128 .shouldMatch(".class.load. org.astro.World source:.*org.astro.jar");
129 });
130
131 // create an archive with modular jar files in both -cp and --module-path
132 String jars = subJar.toString() + System.getProperty("path.separator") +
133 mainJar.toString();
134 output = TestCommon.createArchive( jars, appClasses,
135 "-Xlog:class+load=trace",
136 "--module-path", moduleDir.toString(),
137 "-m", MAIN_MODULE);
138 TestCommon.checkDump(output);
139
140 // run with archive with the main class name specified before
141 // the module name with the -m option. Since the -m option was specified
142 // during dump time, the classes in the jar files after the -cp won't be
143 // archived. Therefore, the classes won't be loaded from the archive but
144 // will be loaded from the jar files.
145 TestCommon.run("-Xlog:class+load=trace",
146 "-cp", jars,
147 "--module-path", moduleDir.toString(),
148 MAIN_CLASS, "-m", MAIN_MODULE)
149 .assertNormalExit(out -> {
150 out.shouldMatch(".class.load. com.greetings.Main source:.*com.greetings.jar")
151 .shouldMatch(".class.load. org.astro.World source:.*org.astro.jar");
152 });
153
154 // similar to the above case but without the main class name. The classes
155 // should be loaded from the archive.
|