Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ObjectReference/GetValues/getvalues001a.java
41161 views
1
/*
2
* Copyright (c) 2001, 2018, 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
package nsk.jdwp.ObjectReference.GetValues;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdwp.*;
29
30
import java.io.*;
31
32
public class getvalues001a {
33
34
public static final String OBJECT_FIELD_NAME = "object";
35
36
public static void main(String args[]) {
37
getvalues001a _getvalues001a = new getvalues001a();
38
System.exit(getvalues001.JCK_STATUS_BASE + _getvalues001a.runIt(args, System.err));
39
}
40
41
public int runIt(String args[], PrintStream out) {
42
//make log for debugee messages
43
ArgumentHandler argumentHandler = new ArgumentHandler(args);
44
Log log = new Log(out, argumentHandler);
45
46
// meke communication pipe to debugger
47
log.display("Creating pipe");
48
IOPipe pipe = argumentHandler.createDebugeeIOPipe(log);
49
50
// ensure tested class loaded
51
log.display("Creating object of tested class");
52
TestedClass.object = new TestedClass();
53
54
// send debugger signal READY
55
log.display("Sending signal to debugger: " + getvalues001.READY);
56
pipe.println(getvalues001.READY);
57
58
// wait for signal QUIT from debugeer
59
log.display("Waiting for signal from debugger: " + getvalues001.QUIT);
60
String signal = pipe.readln();
61
log.display("Received signal from debugger: " + signal);
62
63
// check received signal
64
if (! signal.equals(getvalues001.QUIT)) {
65
log.complain("Unexpected communication signal from debugee: " + signal
66
+ " (expected: " + getvalues001.QUIT + ")");
67
log.display("Debugee FAILED");
68
return getvalues001.FAILED;
69
}
70
71
// exit debugee
72
log.display("Debugee PASSED");
73
return getvalues001.PASSED;
74
}
75
76
// tested class with own static fields values
77
public static class TestedClass {
78
79
// static field with tested object
80
public static TestedClass object = null;
81
82
// fields with tested values
83
private boolean booleanValue = true;
84
private final byte byteValue = (byte)0x0F;
85
protected char charValue = 'Z';
86
protected final int intValue = 100;
87
public short shortValue = (short)10;
88
public final long longValue = (long)1000000;
89
float floatValue = (float)3.14;
90
final double doubleValue = (double)2.8e-12;
91
TestedClass objectValue = null;
92
}
93
}
94
95