Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/threadgroup/threadgroup002/threadgroup002.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/threadgroup/threadgroup002.
29
* VM Testbase keywords: [jpda, jdb]
30
* VM Testbase readme:
31
* DECSRIPTION
32
* This is a test for jdb 'threadgroup <threadgroup_name>' 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 test passes if jdb correctly switches between
36
* three user-defined threadgroups using 'threadgroup' command.
37
* COMMENTS
38
* This test functionally equals to nsk/jdb/threadgroup/threadgroup001
39
* test and replaces it.
40
*
41
* @library /vmTestbase
42
* /test/lib
43
* @build nsk.jdb.threadgroup.threadgroup002.threadgroup002a
44
* @run main/othervm
45
* nsk.jdb.threadgroup.threadgroup002.threadgroup002
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.threadgroup.threadgroup002;
57
58
import nsk.share.*;
59
import nsk.share.jdb.*;
60
61
import java.io.*;
62
import java.util.*;
63
64
public class threadgroup002 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 threadgroup002().runTest(argv, out);
75
}
76
77
static final String PACKAGE_NAME = "nsk.jdb.threadgroup.threadgroup002";
78
static final String TEST_CLASS = PACKAGE_NAME + ".threadgroup002";
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
jdb.receiveReplyFor(JdbCommand.threadgroups);
93
94
for (int i = 0; i < threadgroup002a.numThreadGroups; i++) {
95
reply = jdb.receiveReplyFor(JdbCommand.threadgroup + threadgroup002a.THREADGROUP_NAME + i);
96
grep = new Paragrep(reply);
97
count = grep.find("not a valid threadgroup name");
98
if (count > 0) {
99
failure("jdb cannot switch to valid threadgroup: " + threadgroup002a.THREADGROUP_NAME + i);
100
}
101
}
102
103
jdb.contToExit(1);
104
}
105
}
106
107