< prev index next >

test/lib/testlibrary/jdk/testlibrary/Platform.java

Print this page
rev 11038 : 8067291: Need additional vm checks in jdk/test/lib/testlibrary/jdk/testlibrary/Platform, checking which vm is run
Reviewed-by: iignatyev
Contributed-by: dmitrij.pochepko@oracle.com


  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 jdk.testlibrary;
  25 
  26 public class Platform {
  27     private static final String osName      = System.getProperty("os.name");
  28     private static final String dataModel   = System.getProperty("sun.arch.data.model");
  29     private static final String vmVersion   = System.getProperty("java.vm.version");
  30     private static final String osArch      = System.getProperty("os.arch");









  31 
  32     public static boolean is32bit() {
  33         return dataModel.equals("32");
  34     }
  35 
  36     public static boolean is64bit() {
  37         return dataModel.equals("64");
  38     }
  39 
  40     public static boolean isSolaris() {
  41         return isOs("sunos");
  42     }
  43 
  44     public static boolean isWindows() {
  45         return isOs("win");
  46     }
  47 
  48     public static boolean isOSX() {
  49         return isOs("mac");
  50     }




  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 jdk.testlibrary;
  25 
  26 public class Platform {
  27     private static final String osName      = System.getProperty("os.name");
  28     private static final String dataModel   = System.getProperty("sun.arch.data.model");
  29     private static final String vmVersion   = System.getProperty("java.vm.version");
  30     private static final String osArch      = System.getProperty("os.arch");
  31     private static final String vmName      = System.getProperty("java.vm.name");
  32 
  33     public static boolean isClient() {
  34         return vmName.endsWith(" Client VM");
  35     }
  36 
  37     public static boolean isServer() {
  38         return vmName.endsWith(" Server VM");
  39     }
  40 
  41     public static boolean is32bit() {
  42         return dataModel.equals("32");
  43     }
  44 
  45     public static boolean is64bit() {
  46         return dataModel.equals("64");
  47     }
  48 
  49     public static boolean isSolaris() {
  50         return isOs("sunos");
  51     }
  52 
  53     public static boolean isWindows() {
  54         return isOs("win");
  55     }
  56 
  57     public static boolean isOSX() {
  58         return isOs("mac");
  59     }


< prev index next >