From 863bf52eae99105d4299472e747632dec8390a8c Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Fri, 21 Mar 2014 02:02:04 +0000 Subject: [PATCH] Add org.apache.commons.lang3.SystemUtils.IS_JAVA_1_8 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1579865 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/lang3/SystemUtilsTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java index 0a683afd6..a2cdc0c48 100644 --- a/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/SystemUtilsTest.java @@ -148,6 +148,24 @@ public class SystemUtilsTest { assertFalse(SystemUtils.IS_JAVA_1_5); assertTrue(SystemUtils.IS_JAVA_1_6); assertFalse(SystemUtils.IS_JAVA_1_7); + } else if (javaVersion.startsWith("1.7")) { + assertFalse(SystemUtils.IS_JAVA_1_1); + assertFalse(SystemUtils.IS_JAVA_1_2); + assertFalse(SystemUtils.IS_JAVA_1_3); + assertFalse(SystemUtils.IS_JAVA_1_4); + assertFalse(SystemUtils.IS_JAVA_1_5); + assertFalse(SystemUtils.IS_JAVA_1_6); + assertTrue(SystemUtils.IS_JAVA_1_7); + assertFalse(SystemUtils.IS_JAVA_1_8); + } else if (javaVersion.startsWith("1.8")) { + assertFalse(SystemUtils.IS_JAVA_1_1); + assertFalse(SystemUtils.IS_JAVA_1_2); + assertFalse(SystemUtils.IS_JAVA_1_3); + assertFalse(SystemUtils.IS_JAVA_1_4); + assertFalse(SystemUtils.IS_JAVA_1_5); + assertFalse(SystemUtils.IS_JAVA_1_6); + assertFalse(SystemUtils.IS_JAVA_1_7); + assertTrue(SystemUtils.IS_JAVA_1_8); } else { System.out.println("Can't test IS_JAVA value: "+javaVersion); }