Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/runtime/6981737/Test6981737.java
40942 views
1
/*
2
* Copyright (c) 2010, 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
/*
25
* @test Test6981737.java
26
* @bug 6981737 8204565
27
* @summary check for correct vm properties
28
* @run main Test6981737
29
* @author kamg
30
*/
31
32
public class Test6981737 {
33
34
/**
35
* Check the 'vendor' properties and java.vm.specification.version property.
36
*/
37
public static void main(String[] args) throws Exception {
38
39
String vendor_re = "Oracle Corporation";
40
int feature_version = Runtime.version().feature();
41
String vm_spec_version_re = Integer.toString(feature_version);
42
43
verifyProperty("java.vm.specification.vendor", vendor_re);
44
verifyProperty("java.specification.vendor", vendor_re);
45
verifyProperty("java.vm.specification.version", vm_spec_version_re);
46
System.out.println("PASS");
47
}
48
49
public static String verifyProperty(String name, String expected_re) {
50
String value = System.getProperty(name, "");
51
System.out.print("Checking " + name + ": \"" + value +
52
"\".matches(\"" + expected_re + "\")... ");
53
if (!value.matches(expected_re)) {
54
System.out.println("no.");
55
throw new RuntimeException("FAIL: Wrong value for " + name +
56
" property, \"" + value + "\", expected to be of form: \"" +
57
expected_re + "\"");
58
}
59
System.out.println("yes.");
60
return value;
61
}
62
}
63
64