test/hotspot/jtreg/runtime/6981737/Test6981737.java
changeset 50531 aeb7fb702890
parent 48553 fe2950b07f1e
equal deleted inserted replaced
50530:7e3aa681a484 50531:aeb7fb702890
     1 /*
     1 /*
     2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
     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.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test Test6981737.java
    25  * @test Test6981737.java
    26  * @bug 6981737
    26  * @bug 6981737 8204565
    27  * @summary check for correct vm properties
    27  * @summary check for correct vm properties
    28  * @run main Test6981737
    28  * @run main Test6981737
    29  * @author kamg
    29  * @author kamg
    30 */
    30 */
    31 
    31 
    32 public class Test6981737 {
    32 public class Test6981737 {
    33 
    33 
    34     /**
    34     /**
    35      * Check the 'vendor' properties and java.vm.specification.version property.
    35      * Check the 'vendor' properties and java.vm.specification.version property.
    36      * In jdk9 onwards they should be "Oracle..." and "<major_version>"
       
    37      */
    36      */
    38     public static void main(String[] args) throws Exception {
    37     public static void main(String[] args) throws Exception {
    39 
    38 
    40         String vendor_re = "Oracle Corporation";
    39         String vendor_re = "Oracle Corporation";
    41         int major_version = Runtime.version().major();
    40         int feature_version = Runtime.version().feature();
    42         String vm_spec_version_re = Integer.toString(major_version);
    41         String vm_spec_version_re = Integer.toString(feature_version);
    43 
    42 
    44         verifyProperty("java.vm.specification.vendor", vendor_re);
    43         verifyProperty("java.vm.specification.vendor", vendor_re);
    45         verifyProperty("java.specification.vendor", vendor_re);
    44         verifyProperty("java.specification.vendor", vendor_re);
    46         verifyProperty("java.vm.specification.version", vm_spec_version_re);
    45         verifyProperty("java.vm.specification.version", vm_spec_version_re);
    47         System.out.println("PASS");
    46         System.out.println("PASS");