Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/Argument/label/label001.java
41160 views
1
/*
2
* Copyright (c) 2000, 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.jdi.Argument.label;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
import com.sun.jdi.*;
31
import com.sun.jdi.connect.Connector;
32
import java.io.*;
33
import javax.naming.directory.Attribute;
34
import java.util.*;
35
36
/**
37
* Test for the control of
38
*
39
* Interface: com.sun.jdi.connect.Connector.Argument
40
* Method: public java.lang.String label()
41
* Assertion: "Returns a short human-readable label for
42
* this argument."
43
*/
44
45
public class label001 {
46
private static Log log;
47
48
public static void main( String argv[] ) {
49
System.exit(run(argv, System.out)+95); // JCK-compatible exit status
50
}
51
52
public static int run(String argv[], PrintStream out) {
53
ArgumentHandler argHandler = new ArgumentHandler(argv);
54
log = new Log(out, argHandler);
55
VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
56
57
List acl = vmm.allConnectors();
58
if (acl.size() > 0) {
59
log.display("Number of all known JDI connectors: " + acl.size());
60
} else {
61
log.complain("FAILURE: no JDI connectors found!");
62
return 2;
63
}
64
65
Iterator aci = acl.iterator();
66
for (int i = 1; aci.hasNext(); i++) {
67
Connector c = (Connector) aci.next();
68
Map cdfltArgmnts = c.defaultArguments();
69
Set ks = cdfltArgmnts.keySet();
70
71
if (ks.isEmpty()) {
72
log.complain("FAILURE: empty default arguments set is found "
73
+ "for " + c.name() + " connector!");
74
return 2;
75
}
76
77
log.display("Looking over " + c.name() + " connector arguments: ");
78
79
Iterator argi = ks.iterator();
80
for (int j = 1; argi.hasNext(); j++) {
81
String argkey = (String) argi.next();
82
Connector.Argument argval =
83
(Connector.Argument)cdfltArgmnts.get((Object) argkey);
84
String lbl = argval.label();
85
86
if (lbl == null) {
87
log.complain("FAILURE: argument label is null "
88
+ "for " + argkey + " argument of "
89
+ c.name() + " connector!");
90
return 2;
91
}
92
93
if (lbl.length() < 1) {
94
log.complain("FAILURE: empty argument label is found "
95
+ "for " + argkey + " argument of "
96
+ c.name() + " connector!");
97
return 2;
98
}
99
100
log.display("Next (" + j + ") argument's label is: " + lbl);
101
};
102
};
103
log.display("Test PASSED!");
104
return 0;
105
}
106
}
107
108