51 // check output to contain the string "Concurrent RS threads times (s)" followed by |
51 // check output to contain the string "Concurrent RS threads times (s)" followed by |
52 // the correct number of values in the next line. |
52 // the correct number of values in the next line. |
53 |
53 |
54 // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. |
54 // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. |
55 // Additionally use at least one thread. |
55 // Additionally use at least one thread. |
56 int expectedNumRefinementThreads = refinementThreads == 0 ? workerThreads : refinementThreads; |
56 int expectedNumRefinementThreads = refinementThreads; |
57 expectedNumRefinementThreads = Math.max(1, expectedNumRefinementThreads); |
57 |
58 // create the pattern made up of n copies of a floating point number pattern |
58 // create the pattern made up of n copies of a floating point number pattern |
59 String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0) |
59 String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0) |
60 .replace("0", "\\s+\\d+\\.\\d+"); |
60 .replace("0", "\\s+\\d+\\.\\d+"); |
61 String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$"; |
61 String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$"; |
62 Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); |
62 Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); |