test/jtreg-ext/requires/VMProps.java
changeset 50590 5fa19bad622d
parent 50455 2b73cce96dce
child 50708 bd3a8f48597e
--- a/test/jtreg-ext/requires/VMProps.java	Fri Jun 15 09:16:48 2018 -0700
+++ b/test/jtreg-ext/requires/VMProps.java	Fri Jun 15 09:53:28 2018 -0700
@@ -22,7 +22,10 @@
  */
 package requires;
 
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -31,6 +34,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
@@ -80,6 +84,7 @@
         // vm.graal.enabled is true if Graal is used as JIT
         map.put("vm.graal.enabled", isGraalEnabled());
         map.put("docker.support", dockerSupport());
+        map.put("release.implementor", implementor());
         vmGC(map); // vm.gc.X = true/false
         vmOptFinalFlags(map);
 
@@ -396,6 +401,18 @@
     }
 
 
+    private String implementor() {
+        try (InputStream in = new BufferedInputStream(new FileInputStream(
+                System.getProperty("java.home") + "/release"))) {
+            Properties properties = new Properties();
+            properties.load(in);
+            return properties.getProperty("IMPLEMENTOR").replace("\"", "");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
 
     /**
      * Dumps the map to the file if the file name is given as the property.