/** * Decides if the operating system matches. * * @param osNamePrefix the prefix for the OS name * @param osVersionPrefix the prefix for the version * @return true if matches, or false if not or can't determine */ private static boolean getOsMatches(final String osNamePrefix, final String osVersionPrefix) { return isOSMatch(OS_NAME, OS_VERSION, osNamePrefix, osVersionPrefix); }
@Test public void testOSMatchesNameAndVersion() { String osName = null; String osVersion = null; assertFalse(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = ""; osVersion = ""; assertFalse(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = "Windows 95"; osVersion = "4.0"; assertFalse(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = "Windows 95"; osVersion = "4.1"; assertTrue(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = "Windows 98"; osVersion = "4.1"; assertTrue(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = "Windows NT"; osVersion = "4.0"; assertFalse(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); osName = "OS/2"; osVersion = "4.0"; assertFalse(SystemUtils.isOSMatch(osName, osVersion, "Windows 9", "4.1")); }
/** * Decides if the operating system matches. * * @param osNamePrefix the prefix for the OS name * @param osVersionPrefix the prefix for the version * @return true if matches, or false if not or can't determine */ private static boolean getOsMatches(final String osNamePrefix, final String osVersionPrefix) { return isOSMatch(OS_NAME, OS_VERSION, osNamePrefix, osVersionPrefix); }
/** * Decides if the operating system matches. * * @param osNamePrefix the prefix for the OS name * @param osVersionPrefix the prefix for the version * @return true if matches, or false if not or can't determine */ private static boolean getOsMatches(final String osNamePrefix, final String osVersionPrefix) { return isOSMatch(OS_NAME, OS_VERSION, osNamePrefix, osVersionPrefix); }
/** * Decides if the operating system matches. * * @param osNamePrefix the prefix for the OS name * @param osVersionPrefix the prefix for the version * @return true if matches, or false if not or can't determine */ private static boolean getOsMatches(final String osNamePrefix, final String osVersionPrefix) { return isOSMatch(OS_NAME, OS_VERSION, osNamePrefix, osVersionPrefix); }