8067291: Need additional vm checks in jdk/test/lib/testlibrary/jdk/testlibrary/Platform, checking which vm is run
authordpochepk
Fri, 12 Dec 2014 00:40:56 +0300
changeset 28413 480f59792897
parent 28412 adcb8be2a2b0
child 28414 19769301f6bc
8067291: Need additional vm checks in jdk/test/lib/testlibrary/jdk/testlibrary/Platform, checking which vm is run Reviewed-by: fzhinkin, iignatyev
jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java	Wed Dec 24 17:54:00 2014 +0300
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java	Fri Dec 12 00:40:56 2014 +0300
@@ -28,6 +28,15 @@
     private static final String dataModel   = System.getProperty("sun.arch.data.model");
     private static final String vmVersion   = System.getProperty("java.vm.version");
     private static final String osArch      = System.getProperty("os.arch");
+    private static final String vmName      = System.getProperty("java.vm.name");
+
+    public static boolean isClient() {
+        return vmName.endsWith(" Client VM");
+    }
+
+    public static boolean isServer() {
+        return vmName.endsWith(" Server VM");
+    }
 
     public static boolean is32bit() {
         return dataModel.equals("32");