commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r389912 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/SystemUtils.java test/org/apache/commons/lang/SystemUtilsTest.java
Date Wed, 29 Mar 2006 22:27:49 GMT
Author: scolebourne
Date: Wed Mar 29 14:27:48 2006
New Revision: 389912

URL: http://svn.apache.org/viewcvs?rev=389912&view=rev
Log:
Add checks for JDK1.6

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/SystemUtilsTest.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java?rev=389912&r1=389911&r2=389912&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java Wed
Mar 29 14:27:48 2006
@@ -876,6 +876,14 @@
      */
     public static final boolean IS_JAVA_1_5 = getJavaVersionMatches("1.5");
 
+    /**
+     * <p>Is <code>true</code> if this is Java version 1.6 (also 1.6.x
versions).</p>
+     *
+     * <p>The field will return <code>false</code> if {@link #JAVA_VERSION}
is
+     * <code>null</code>.</p>
+     */
+    public static final boolean IS_JAVA_1_6 = getJavaVersionMatches("1.6");
+
     // Operating system checks
     //-----------------------------------------------------------------------
     // These MUST be declared after those above as they depend on the

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/SystemUtilsTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/SystemUtilsTest.java?rev=389912&r1=389911&r2=389912&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/SystemUtilsTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/SystemUtilsTest.java
Wed Mar 29 14:27:48 2006
@@ -245,16 +245,49 @@
             assertEquals(false, SystemUtils.IS_JAVA_1_3);
             assertEquals(false, SystemUtils.IS_JAVA_1_4);
             assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
         } else if (javaVersion.startsWith("1.1")) {
-            assertTrue(SystemUtils.IS_JAVA_1_1);
+            assertEquals(true, SystemUtils.IS_JAVA_1_1);
+            assertEquals(false, SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
         } else if (javaVersion.startsWith("1.2")) {
-            assertTrue(SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_1);
+            assertEquals(true, SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
         } else if (javaVersion.startsWith("1.3")) {
-            assertTrue(SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_1);
+            assertEquals(false, SystemUtils.IS_JAVA_1_2);
+            assertEquals(true, SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
         } else if (javaVersion.startsWith("1.4")) {
-            assertTrue(SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_1);
+            assertEquals(false, SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_3);
+            assertEquals(true, SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
         } else if (javaVersion.startsWith("1.5")) {
-            assertTrue(SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_1);
+            assertEquals(false, SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_4);
+            assertEquals(true, SystemUtils.IS_JAVA_1_5);
+            assertEquals(false, SystemUtils.IS_JAVA_1_6);
+        } else if (javaVersion.startsWith("1.6")) {
+            assertEquals(false, SystemUtils.IS_JAVA_1_1);
+            assertEquals(false, SystemUtils.IS_JAVA_1_2);
+            assertEquals(false, SystemUtils.IS_JAVA_1_3);
+            assertEquals(false, SystemUtils.IS_JAVA_1_4);
+            assertEquals(false, SystemUtils.IS_JAVA_1_5);
+            assertEquals(true, SystemUtils.IS_JAVA_1_6);
         } else {
             System.out.println("Can't test IS_JAVA value");
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message