test/serviceability/dcmd/compiler/CompilerQueueTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff test/serviceability/dcmd/compiler/CompilerQueueTest.java

test/serviceability/dcmd/compiler/CompilerQueueTest.java

Print this page
rev 7093 : 8058891: serviceability/dcmd/CodelistTest.java - fails on all platforms
Summary: Fix can not reflect MethodHandles
Reviewed-by:

*** 22,33 **** --- 22,35 ---- */ /* * @test CompilerQueueTest * @bug 8054889 + * @library .. * @build DcmdUtil CompilerQueueTest * @run main CompilerQueueTest + * @run main/othervm -Xint CompilerQueueTest * @summary Test of diagnostic command Compiler.queue */ import java.io.BufferedReader; import java.io.StringReader;
*** 60,104 **** // Get output from dcmd (diagnostic command) String result = DcmdUtil.executeDcmd("Compiler.queue"); BufferedReader r = new BufferedReader(new StringReader(result)); - String line; - match(r.readLine(), "Contents of C1 compile queue"); - match(r.readLine(), "----------------------------"); String str = r.readLine(); - if (!str.equals("Empty")) { - while (str.charAt(0) != '-') { - validateMethodLine(str); - str = r.readLine(); - } - } else { - str = r.readLine(); - } ! match(str, "----------------------------"); ! match(r.readLine(), "Contents of C2 compile queue"); match(r.readLine(), "----------------------------"); str = r.readLine(); if (!str.equals("Empty")) { while (str.charAt(0) != '-') { validateMethodLine(str); str = r.readLine(); } } else { str = r.readLine(); } ! match(str, "----------------------------"); } private static void validateMethodLine(String str) throws Exception { String name = str.substring(19); int sep = name.indexOf("::"); try { Class.forName(name.substring(0, sep)); } catch (ClassNotFoundException e) { ! throw new Exception("Failed parsing dcmd queue"); } } public static void match(String line, String str) throws Exception { if (!line.equals(str)) { --- 62,103 ---- // Get output from dcmd (diagnostic command) String result = DcmdUtil.executeDcmd("Compiler.queue"); BufferedReader r = new BufferedReader(new StringReader(result)); String str = r.readLine(); ! while (str != null) { ! if (str.startsWith("Contents of C")) { match(r.readLine(), "----------------------------"); str = r.readLine(); if (!str.equals("Empty")) { while (str.charAt(0) != '-') { validateMethodLine(str); str = r.readLine(); } } else { str = r.readLine(); } ! match(str,"----------------------------"); ! str = r.readLine(); ! } else { ! throw new Exception("Failed parsing dcmd queue, line: " + str); ! } ! } } private static void validateMethodLine(String str) throws Exception { String name = str.substring(19); int sep = name.indexOf("::"); + if (sep == -1) { + throw new Exception("Failed dcmd queue, didn't find separator :: in: " + name); + } try { Class.forName(name.substring(0, sep)); } catch (ClassNotFoundException e) { ! throw new Exception("Failed dcmd queue, Class for name: " + str); } } public static void match(String line, String str) throws Exception { if (!line.equals(str)) {
test/serviceability/dcmd/compiler/CompilerQueueTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File