changeset 2271:40c4c2e2cdf3

Merge
author dlong
date Tue, 27 Sep 2016 20:57:47 -0400
parents d45240297def (current diff) e4c5488bfc95 (diff)
children c623a5f16cf0
files
diffstat 2 files changed, 41 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/lib/jdk/test/lib/Platform.java	Fri Sep 23 13:44:01 2016 -0700
+++ b/test/lib/jdk/test/lib/Platform.java	Tue Sep 27 20:57:47 2016 -0400
@@ -28,6 +28,9 @@
 public class Platform {
     public  static final String vmName      = System.getProperty("java.vm.name");
     public  static final String vmInfo      = System.getProperty("java.vm.info");
+    private static final String osVersion   = System.getProperty("os.version");
+    private static       int osVersionMajor = -1;
+    private static       int osVersionMinor = -1;
     private static final String osName      = System.getProperty("os.name");
     private static final String dataModel   = System.getProperty("sun.arch.data.model");
     private static final String vmVersion   = System.getProperty("java.vm.version");
@@ -112,6 +115,35 @@
         return osName;
     }
 
+    // Os version support.
+    private static void init_version() {
+        try {
+            final String[] tokens = osVersion.split("\\.");
+            if (tokens.length > 0) {
+                osVersionMajor = Integer.parseInt(tokens[0]);
+                if (tokens.length > 1) {
+                    osVersionMinor = Integer.parseInt(tokens[1]);
+                }
+            }
+        } catch (NumberFormatException e) {
+            osVersionMajor = osVersionMinor = 0;
+        }
+    }
+
+    // Returns major version number from os.version system property.
+    // E.g. 5 on Solaris 10 and 3 on SLES 11.3 (for the linux kernel version).
+    public static int getOsVersionMajor() {
+        if (osVersionMajor == -1) init_version();
+        return osVersionMajor;
+    }
+
+    // Returns minor version number from os.version system property.
+    // E.g. 10 on Solaris 10 and 0 on SLES 11.3 (for the linux kernel version).
+    public static int getOsVersionMinor() {
+        if (osVersionMinor == -1) init_version();
+        return osVersionMinor;
+    }
+
     public static boolean isDebugBuild() {
         return (jdkDebug.toLowerCase().contains("debug"));
     }
--- a/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java	Fri Sep 23 13:44:01 2016 -0700
+++ b/test/lib/jdk/test/lib/cli/predicate/AndPredicate.java	Tue Sep 27 20:57:47 2016 -0400
@@ -28,14 +28,22 @@
 public class AndPredicate implements BooleanSupplier {
     private final BooleanSupplier a;
     private final BooleanSupplier b;
+    private final BooleanSupplier c;
 
     public AndPredicate(BooleanSupplier a, BooleanSupplier b) {
         this.a = a;
         this.b = b;
+        this.c = () -> true; // Boolean.TRUE::booleanValue
+    }
+
+    public AndPredicate(BooleanSupplier a, BooleanSupplier b, BooleanSupplier c) {
+        this.a = a;
+        this.b = b;
+        this.c = c;
     }
 
     @Override
     public boolean getAsBoolean() {
-        return a.getAsBoolean() && b.getAsBoolean();
+        return a.getAsBoolean() && b.getAsBoolean() && c.getAsBoolean();
     }
 }