Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/threadgroups/threadgroups002/threadgroups002.java
40951 views
1
/*
2
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
25
/*
26
* @test
27
*
28
* @summary converted from VM Testbase nsk/jdb/threadgroups/threadgroups002.
29
* VM Testbase keywords: [jpda, jdb]
30
* VM Testbase readme:
31
* DECSRIPTION
32
* This is a test for jdb 'threadgroups' command.
33
* The main thread creates 3 threadgroups of 5 threads each.
34
* All threads are locked in their 'run' method on a lock that the main
35
* thread holds. The 'threadgroups' command is issued at this point.
36
* The test passes if three user-defined threadgroups are reported.
37
* COMMENTS
38
* This test functionally equals to nsk/jdb/threadgroups/threadgroups001
39
* test and replaces it.
40
*
41
* @library /vmTestbase
42
* /test/lib
43
* @build nsk.jdb.threadgroups.threadgroups002.threadgroups002a
44
* @run main/othervm
45
* nsk.jdb.threadgroups.threadgroups002.threadgroups002
46
* -arch=${os.family}-${os.simpleArch}
47
* -waittime=5
48
* -debugee.vmkind=java
49
* -transport.address=dynamic
50
* -jdb=${test.jdk}/bin/jdb
51
* -java.options="${test.vm.opts} ${test.java.opts}"
52
* -workdir=.
53
* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
54
*/
55
56
package nsk.jdb.threadgroups.threadgroups002;
57
58
import nsk.share.*;
59
import nsk.share.jdb.*;
60
61
import java.io.*;
62
import java.util.*;
63
64
public class threadgroups002 extends JdbTest {
65
66
public static void main (String argv[]) {
67
System.exit(run(argv, System.out) + JCK_STATUS_BASE);
68
}
69
70
public static int run(String argv[], PrintStream out) {
71
debuggeeClass = DEBUGGEE_CLASS;
72
firstBreak = FIRST_BREAK;
73
lastBreak = LAST_BREAK;
74
return new threadgroups002().runTest(argv, out);
75
}
76
77
static final String PACKAGE_NAME = "nsk.jdb.threadgroups.threadgroups002";
78
static final String TEST_CLASS = PACKAGE_NAME + ".threadgroups002";
79
static final String DEBUGGEE_CLASS = TEST_CLASS + "a";
80
static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main";
81
static final String LAST_BREAK = DEBUGGEE_CLASS + ".lastBreak";
82
83
protected void runCases() {
84
String[] reply;
85
Paragrep grep;
86
int count;
87
Vector v;
88
String found;
89
90
jdb.setBreakpointInMethod(LAST_BREAK);
91
jdb.receiveReplyFor(JdbCommand.cont);
92
93
reply = jdb.receiveReplyFor(JdbCommand.threadgroups);
94
grep = new Paragrep(reply);
95
count = grep.find(threadgroups002a.THREADGROUP_NAME);
96
if (count != threadgroups002a.numThreadGroups ) {
97
failure("Unexpected number of " + threadgroups002a.THREADGROUP_NAME + " was listed: " + count +
98
"\n\texpected value: " + threadgroups002a.numThreadGroups);
99
}
100
101
jdb.contToExit(1);
102
}
103
}
104
105