< prev index next >

test/hotspot/jtreg/runtime/cds/SharedSymbolTableBucketSize.java

Print this page

 68             stat = matcher0.group(0);
 69         }
 70         if (stat == null) {
 71             throw new Exception("FAILED: pattern \"" + pattern0 + "\" not found");
 72         }
 73 
 74         /* (2) The first "Average bucket size" line in the remaining output is for the
 75                shared symbol table */
 76         Pattern pattern = Pattern.compile("Average bucket size *: *([0-9]+\\.[0-9]+).*", Pattern.MULTILINE);
 77         Matcher matcher = pattern.matcher(stat);
 78         String s = null;
 79         if (matcher.find()) {
 80             s = matcher.group(1);
 81         }
 82         if (s == null) {
 83             throw new Exception("FAILED: pattern \"" + pattern + "\" not found");
 84         }
 85 
 86         Float f = Float.parseFloat(s);
 87         int size = Math.round(f);
 88         if (size != bucket_size) {
 89             throw new Exception("FAILED: incorrect bucket size " + size +
 90                                 ", expect " + bucket_size);
 91         }
 92 
 93         // Invalid SharedSymbolTableBucketSize input
 94         String input[] = {"-XX:SharedSymbolTableBucketSize=-1",
 95                           "-XX:SharedSymbolTableBucketSize=2.5"};
 96         for (int i = 0; i < input.length; i++) {
 97             CDSTestUtils.createArchive(input[i])
 98                 .shouldContain("Improperly specified VM option")
 99                 .shouldHaveExitValue(1);
100         }
101     }
102 }

 68             stat = matcher0.group(0);
 69         }
 70         if (stat == null) {
 71             throw new Exception("FAILED: pattern \"" + pattern0 + "\" not found");
 72         }
 73 
 74         /* (2) The first "Average bucket size" line in the remaining output is for the
 75                shared symbol table */
 76         Pattern pattern = Pattern.compile("Average bucket size *: *([0-9]+\\.[0-9]+).*", Pattern.MULTILINE);
 77         Matcher matcher = pattern.matcher(stat);
 78         String s = null;
 79         if (matcher.find()) {
 80             s = matcher.group(1);
 81         }
 82         if (s == null) {
 83             throw new Exception("FAILED: pattern \"" + pattern + "\" not found");
 84         }
 85 
 86         Float f = Float.parseFloat(s);
 87         int size = Math.round(f);
 88         if (size != bucket_size && size != bucket_size + 1) {
 89             throw new Exception("FAILED: incorrect bucket size " + size +
 90                                 ", expect " + bucket_size + ", or " + (bucket_size + 1));
 91         }
 92 
 93         // Invalid SharedSymbolTableBucketSize input
 94         String input[] = {"-XX:SharedSymbolTableBucketSize=-1",
 95                           "-XX:SharedSymbolTableBucketSize=2.5"};
 96         for (int i = 0; i < input.length; i++) {
 97             CDSTestUtils.createArchive(input[i])
 98                 .shouldContain("Improperly specified VM option")
 99                 .shouldHaveExitValue(1);
100         }
101     }
102 }
< prev index next >