author | bchristi |
Fri, 06 May 2016 22:45:32 -0700 | |
changeset 38213 | 2f32787e31b1 |
parent 37400 | 7a596e23c0da |
child 39198 | 050eff9d3bcf |
permissions | -rw-r--r-- |
37400
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
1 |
/* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
4 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
8 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
13 |
* accompanied this code). |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
14 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
18 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
21 |
* questions. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
22 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
23 |
package requires; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
24 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
25 |
import java.io.IOException; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
26 |
import java.nio.file.Files; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
27 |
import java.nio.file.Paths; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
28 |
import java.util.ArrayList; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
29 |
import java.util.HashMap; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
30 |
import java.util.List; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
31 |
import java.util.Map; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
32 |
import java.util.concurrent.Callable; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
33 |
import java.util.regex.Matcher; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
34 |
import java.util.regex.Pattern; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
35 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
36 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
37 |
* The Class to be invoked by jtreg prior Test Suite execution to |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
38 |
* collect information about VM. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
39 |
* Properties set by this Class will be available in the @requires expressions. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
40 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
41 |
public class VMProps implements Callable<Map<String, String>> { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
42 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
43 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
44 |
* Collects information about VM properties. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
45 |
* This method will be invoked by jtreg. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
46 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
47 |
* @return Map of property-value pairs. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
48 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
49 |
@Override |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
50 |
public Map<String, String> call() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
51 |
Map<String, String> map = new HashMap<>(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
52 |
map.put("vm.flavor", vmFlavor()); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
53 |
map.put("vm.compMode", vmCompMode()); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
54 |
map.put("vm.bits", vmBits()); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
55 |
dump(map); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
56 |
return map; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
57 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
58 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
59 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
60 |
* @return VM type value extracted from the "java.vm.name" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
61 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
62 |
protected String vmFlavor() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
63 |
// E.g. "Java HotSpot(TM) 64-Bit Server VM" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
64 |
String vmName = System.getProperty("java.vm.name"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
65 |
if (vmName == null) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
66 |
return null; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
67 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
68 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
69 |
Pattern startP = Pattern.compile(".* (\\S+) VM"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
70 |
Matcher m = startP.matcher(vmName); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
71 |
if (m.matches()) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
72 |
return m.group(1).toLowerCase(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
73 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
74 |
return null; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
75 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
76 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
77 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
78 |
* @return VM compilation mode extracted from the "java.vm.info" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
79 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
80 |
protected String vmCompMode() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
81 |
// E.g. "mixed mode" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
82 |
String vmInfo = System.getProperty("java.vm.info"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
83 |
if (vmInfo == null) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
84 |
return null; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
85 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
86 |
int k = vmInfo.toLowerCase().indexOf(" mode"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
87 |
if (k < 0) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
88 |
return null; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
89 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
90 |
vmInfo = vmInfo.substring(0, k); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
91 |
switch (vmInfo) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
92 |
case "mixed" : return "Xmixed"; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
93 |
case "compiled" : return "Xcomp"; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
94 |
case "interpreted" : return "Xint"; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
95 |
default: return null; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
96 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
97 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
98 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
99 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
100 |
* @return VM bitness, the value of the "sun.arch.data.model" property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
101 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
102 |
protected String vmBits() { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
103 |
return System.getProperty("sun.arch.data.model"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
104 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
105 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
106 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
107 |
* Dumps the map to the file if the file name is given as the property. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
108 |
* This functionality could be helpful to know context in the real |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
109 |
* execution. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
110 |
* |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
111 |
* @param map |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
112 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
113 |
protected void dump(Map<String, String> map) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
114 |
String dumpFileName = System.getProperty("vmprops.dump"); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
115 |
if (dumpFileName == null) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
116 |
return; |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
117 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
118 |
List<String> lines = new ArrayList<>(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
119 |
map.forEach((k,v) -> lines.add(k + ":" + v)); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
120 |
try { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
121 |
Files.write(Paths.get(dumpFileName), lines); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
122 |
} catch (IOException e) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
123 |
throw new RuntimeException("Failed to dump properties into '" |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
124 |
+ dumpFileName + "'", e); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
125 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
126 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
127 |
|
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
128 |
/** |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
129 |
* This method is for the testing purpose only. |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
130 |
* @param args |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
131 |
*/ |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
132 |
public static void main(String args[]) { |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
133 |
Map<String, String> map = new VMProps().call(); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
134 |
map.forEach((k,v) -> System.out.println(k + ": '" + v + "'")); |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
135 |
} |
7a596e23c0da
8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff
changeset
|
136 |
} |