felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r1700038 - in /felix/trunk/framework/src: main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java
Date Sat, 29 Aug 2015 14:24:18 GMT
Author: bob
Date: Sat Aug 29 14:24:17 2015
New Revision: 1700038

URL: http://svn.apache.org/r1700038
Log:
FELIX-5014 - Added case for Windows versions with no space.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java
    felix/trunk/framework/src/test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java?rev=1700038&r1=1700037&r2=1700038&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClause.java
Sat Aug 29 14:24:17 2015
@@ -602,19 +602,23 @@ public class NativeLibraryClause
             {
                 os = OS_WINDOWS_VISTA;
             }
-            else if ((value.indexOf(" 7") >= 0) || value.equals("win7"))
+            else if ((value.indexOf(" 7") >= 0) || value.startsWith(OS_WINDOWS_7)
+                    || value.equals("win7"))
             {
                 os = OS_WINDOWS_7;
             }
-            else if ((value.indexOf(" 8") >= 0) || value.equals("win8"))
+            else if ((value.indexOf(" 8") >= 0) || value.startsWith(OS_WINDOWS_8)
+                    || value.equals("win8"))
             {
                 os = OS_WINDOWS_8;
             }
-            else if ((value.indexOf(" 9") >= 0) || value.equals("win9"))
+            else if ((value.indexOf(" 9") >= 0) || value.startsWith(OS_WINDOWS_9)
+                    || value.equals("win9"))
             {
                 os = OS_WINDOWS_9;
             }
-            else if ((value.indexOf(" 10") >= 0) || value.equals("win10"))
+            else if ((value.indexOf(" 10") >= 0) || value.startsWith(OS_WINDOWS_10)
+                    || value.equals("win10"))
             {
                 os = OS_WINDOWS_10;
             }

Modified: felix/trunk/framework/src/test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java?rev=1700038&r1=1700037&r2=1700038&view=diff
==============================================================================
--- felix/trunk/framework/src/test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java
(original)
+++ felix/trunk/framework/src/test/java/org/apache/felix/framework/util/manifestparser/NativeLibraryClauseTest.java
Sat Aug 29 14:24:17 2015
@@ -36,6 +36,7 @@ public class NativeLibraryClauseTest ext
         assertEquals("windowsvista", NativeLibraryClause.normalizeOSName("WinVista"));
         assertEquals("windows7", NativeLibraryClause.normalizeOSName("Windows 7"));
         assertEquals("windows8", NativeLibraryClause.normalizeOSName("Win8"));
+        assertEquals("windows10", NativeLibraryClause.normalizeOSName("Windows 10"));
         assertEquals("linux", NativeLibraryClause.normalizeOSName("Linux1.2.3"));
         assertEquals("aix", NativeLibraryClause.normalizeOSName("AIX-4.5.6"));
         assertEquals("digitalunix", NativeLibraryClause.normalizeOSName("digitalunix_blah"));
@@ -71,6 +72,7 @@ public class NativeLibraryClauseTest ext
         assertEquals("windows7", NativeLibraryClause.normalizeOSName("windows7"));
         assertEquals("windows8", NativeLibraryClause.normalizeOSName("windows8"));
         assertEquals("windows9", NativeLibraryClause.normalizeOSName("windows9"));
+        assertEquals("windows10", NativeLibraryClause.normalizeOSName("windows10"));
         assertEquals("windows95", NativeLibraryClause.normalizeOSName("windows95"));
         assertEquals("windows98", NativeLibraryClause.normalizeOSName("windows98"));
         assertEquals("windowsce", NativeLibraryClause.normalizeOSName("windowsce"));
@@ -98,6 +100,7 @@ public class NativeLibraryClauseTest ext
         assertTrue(NativeLibraryClause.getOsNameWithAliases("Windows 7").contains("windows7"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("Windows7").contains("windows7"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("Win8").contains("windows8"));
+        assertTrue(NativeLibraryClause.getOsNameWithAliases("Windows 10").contains("windows10"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("Linux1.2.3").contains("linux"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("AIX-4.5.6").contains("aix"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("digitalunix_blah").contains("digitalunix"));
@@ -133,6 +136,7 @@ public class NativeLibraryClauseTest ext
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windows7").contains("windows7"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windows8").contains("windows8"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windows9").contains("windows9"));
+        assertTrue(NativeLibraryClause.getOsNameWithAliases("windows10").contains("windows10"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windows95").contains("windows95"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windows98").contains("windows98"));
         assertTrue(NativeLibraryClause.getOsNameWithAliases("windowsce").contains("windowsce"));



Mime
View raw message