172 output.shouldHaveExitValue(0);
173 checkMatch(listFileName, sourceTarget, EXPECT_NOMATCH, "Failed to filter " + sourceTarget + " in class list file");
174 checkMatch(listFileName, "Hello", EXPECT_MATCH, "Hello should be logged in class list file");
175
176 fileArchive.delete();
177 fileList.delete();
178
179 // 2.3 class loaded by custom loader from shared space.
180 // 2.3.1 dump class list
181 launchArgs = new String[] {
182 "-XX:DumpLoadedClassList=" + listFileName,
183 "-cp",
184 jarFile,
185 mainCutomClass,
186 "3"};
187 pb = ProcessTools.createJavaProcessBuilder(launchArgs);
188 output = TestCommon.executeAndLog(pb, "custom-dump-classlist");
189
190 checkFileExistence("ClassList", fileList);
191
192 checkMatch(listFileName, "Hello id: [0-9]+ super: [0-9]+ source: .*/test-hello.jar", EXPECT_MATCH,
193 "Class Hello should be printed in classlist");
194 // 2.3.2 dump shared archive based on listFileName
195 String archive = "test-hello.jsa";
196 File archiveFile = new File(archive);
197 if (archiveFile.exists()) {
198 archiveFile.delete();
199 }
200 launchArgs = new String[] {
201 "-Xshare:dump",
202 "-XX:SharedClassListFile=" + listFileName,
203 "-XX:SharedArchiveFile=" + archive,
204 "-cp",
205 jarFile,
206 mainCutomClass,
207 "3"};
208 pb = ProcessTools.createJavaProcessBuilder(launchArgs);
209 output = TestCommon.executeAndLog(pb, "custom-dump");
210
211 checkFileExistence("Archive", archiveFile);
212
|
172 output.shouldHaveExitValue(0);
173 checkMatch(listFileName, sourceTarget, EXPECT_NOMATCH, "Failed to filter " + sourceTarget + " in class list file");
174 checkMatch(listFileName, "Hello", EXPECT_MATCH, "Hello should be logged in class list file");
175
176 fileArchive.delete();
177 fileList.delete();
178
179 // 2.3 class loaded by custom loader from shared space.
180 // 2.3.1 dump class list
181 launchArgs = new String[] {
182 "-XX:DumpLoadedClassList=" + listFileName,
183 "-cp",
184 jarFile,
185 mainCutomClass,
186 "3"};
187 pb = ProcessTools.createJavaProcessBuilder(launchArgs);
188 output = TestCommon.executeAndLog(pb, "custom-dump-classlist");
189
190 checkFileExistence("ClassList", fileList);
191
192 checkMatch(listFileName, "Hello id: [0-9]+ super: [0-9]+ interfaces: [0-9]+ source: .*/test-hello.jar", EXPECT_MATCH,
193 "Class Hello should be printed in classlist");
194 // 2.3.2 dump shared archive based on listFileName
195 String archive = "test-hello.jsa";
196 File archiveFile = new File(archive);
197 if (archiveFile.exists()) {
198 archiveFile.delete();
199 }
200 launchArgs = new String[] {
201 "-Xshare:dump",
202 "-XX:SharedClassListFile=" + listFileName,
203 "-XX:SharedArchiveFile=" + archive,
204 "-cp",
205 jarFile,
206 mainCutomClass,
207 "3"};
208 pb = ProcessTools.createJavaProcessBuilder(launchArgs);
209 output = TestCommon.executeAndLog(pb, "custom-dump");
210
211 checkFileExistence("Archive", archiveFile);
212
|