Skip to content

Commit 43861d7

Browse files
committed
8215568: Refactor SA clhsdb tests to use ClhsdbLauncher
Refactoring the SA tests which test clhsdb commands to use ClhsdbLauncher for uniformity and ease of maintainence Reviewed-by: mdoerr Backport-of: 9c09bb9
1 parent b9307bd commit 43861d7

21 files changed

+169
-474
lines changed

test/hotspot/jtreg/resourcehogs/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static void main(String[] args) throws Exception {
7979
// words[0] and words[1] represent the start and end addresses
8080
String cmd = "scanoops " + words[0] + " " + words[1];
8181
expStrMap = new HashMap<>();
82-
expStrMap.put(cmd, List.of("[Ljava/lang/String"));
82+
expStrMap.put(cmd, List.of("\\[Ljava/lang/String"));
8383
test.run(theApp.getPid(), List.of(cmd), expStrMap, null);
8484
} catch (SkippedException e) {
8585
throw e;

test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@ public static void main(String[] args) throws Exception {
179179
"_nofast_getfield",
180180
"_nofast_putfield",
181181
"Constant Pool of",
182-
"public static void main(java.lang.String[])",
182+
"public static void main\\(java.lang.String\\[\\]\\)",
183183
"Bytecode",
184184
"invokevirtual",
185185
"checkcast",

test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@ public static void main(String[] args) throws Exception {
9595
"_nofast_getfield",
9696
"_nofast_putfield",
9797
"Constant Pool of",
98-
"public static void main(java.lang.String[])",
98+
"public static void main\\(java.lang.String\\[\\]\\)",
9999
"Bytecode",
100100
"invokevirtual",
101101
"checkcast",

test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.Map;
2828

2929
import jdk.test.lib.apps.LingeredApp;
30-
import jdk.test.lib.Platform;
3130
import jdk.test.lib.Utils;
3231

3332
/**

test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static void main(String[] args) throws Exception {
6969
"instance of Oop for java/lang/Class");
7070
tokensMap.put("Method*=", "Type is Method");
7171
tokensMap.put("(a java.lang.ref.ReferenceQueue$Lock)",
72-
"instance of Oop for java/lang/ref/ReferenceQueue$Lock");
72+
"instance of Oop for java/lang/ref/ReferenceQueue\\$Lock");
7373

7474
String[] lines = jstackOutput.split("\\R");
7575

test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,15 @@ public static void main(String[] args) throws Exception {
7777

7878
Map<String, List<String>> expStrMap = new HashMap<>();
7979
expStrMap.put(cmdStr, List.of(
80-
"public static void main(java.lang.String[])",
80+
"public static void main\\(java\\.lang\\.String\\[\\]\\)",
8181
"Holder Class",
8282
"public class jdk.test.lib.apps.LingeredApp @",
83+
"public class jdk\\.test\\.lib\\.apps\\.LingeredApp @",
8384
"Bytecode",
8485
"line bci bytecode",
8586
"Exception Table",
8687
"start bci end bci handler bci catch type",
87-
"Constant Pool of [public class jdk.test.lib.apps.LingeredApp @"));
88+
"Constant Pool of \\[public class jdk\\.test\\.lib\\.apps\\.LingeredApp @"));
8889

8990
test.run(theApp.getPid(), cmds, expStrMap, null);
9091
} catch (SkippedException e) {

test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.Map;
2727

2828
import jdk.test.lib.apps.LingeredApp;
29-
import jdk.test.lib.Platform;
3029

3130
/**
3231
* @test
@@ -56,11 +55,11 @@ private static void testJstack(boolean withXcomp) throws Exception {
5655
Map<String, List<String>> expStrMap = new HashMap<>();
5756
expStrMap.put("jstack -v", List.of(
5857
"No deadlocks found",
59-
"Common-Cleaner",
58+
"Common\\-Cleaner",
6059
"Signal Dispatcher",
61-
"java.lang.ref.Finalizer$FinalizerThread.run",
60+
"java.lang.ref.Finalizer\\$FinalizerThread.run",
6261
"java.lang.ref.Reference",
63-
"Method*",
62+
"Method\\*",
6463
"LingeredApp.main"));
6564

6665
test.run(theApp.getPid(), cmds, expStrMap, null);

test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private String runCmd(List<String> commands,
137137
List<String> expectedStr = expectedStrMap.get(cmd);
138138
if (expectedStr != null) {
139139
for (String exp : expectedStr) {
140-
out.shouldContain(exp);
140+
out.shouldMatch(exp);
141141
}
142142
}
143143
}
@@ -146,7 +146,7 @@ private String runCmd(List<String> commands,
146146
List<String> unExpectedStr = unExpectedStrMap.get(cmd);
147147
if (unExpectedStr != null) {
148148
for (String unExp : unExpectedStr) {
149-
out.shouldNotContain(unExp);
149+
out.shouldNotMatch(unExp);
150150
}
151151
}
152152
}

test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.Map;
2727

2828
import jdk.test.lib.apps.LingeredApp;
29-
import jdk.test.lib.Platform;
3029

3130
/**
3231
* @test

test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public static void main(String[] args) throws Exception {
5555
expStrMap.put("printall", List.of(
5656
"aload_0",
5757
"Constant Pool of",
58-
"public static void main(java.lang.String[])",
58+
"public static void main\\(java.lang.String\\[\\]\\)",
5959
"Bytecode",
60-
"[enum] class Song [signature Ljava/lang/Enum<LSong;>;]",
61-
"Method java.lang.Object clone()",
62-
"public static Song[] values()",
60+
"\\[enum\\] class Song \\[signature Ljava/lang/Enum\\<LSong;\\>;\\]",
61+
"Method java.lang.Object clone\\(\\)",
62+
"public static Song\\[\\] values\\(\\)",
6363
"invokevirtual",
6464
"checkcast",
6565
"Field Song HAVANA",

0 commit comments

Comments
 (0)