test/serviceability/dcmd/compiler/CompilerQueueTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/test/serviceability/dcmd/CompilerQueueTest.java	Tue Sep 23 13:56:33 2014
--- new/test/serviceability/dcmd/compiler/CompilerQueueTest.java	Tue Sep 23 13:56:33 2014

*** 22,31 **** --- 22,32 ---- */ /* * @test CompilerQueueTest * @bug 8054889 + * @library .. * @build DcmdUtil CompilerQueueTest * @run main CompilerQueueTest * @summary Test of diagnostic command Compiler.queue */
*** 60,104 **** --- 61,102 ---- // 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"); + 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, "----------------------------"); ! 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 parsing dcmd queue"); ! 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