@Test public void testFind() throws Exception{ String expected_result = "ubuntu12"; String actual_result = os_family.find("debian12"); Assert.assertNotNull(actual_result); Assert.assertEquals(expected_result, actual_result); expected_result = "winsrv6"; actual_result = os_family.find("win2012server6"); Assert.assertNotNull(actual_result); Assert.assertEquals(expected_result, actual_result); }
public String find(String os) { Map<String,String> pos = parse_os(os); for ( String family : osMap.keySet()) { JsonOsFamilyEntry fam = osMap.get(family); if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){ return family + pos.get(OS_VERSION); } } return null; }
OsFamily { public String find(String os) { Map<String,String> pos = parse_os(os); for ( String family : osMap.keySet()) { JsonOsFamilyEntry fam = osMap.get(family); if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){ return family + pos.get(OS_VERSION); } } return null; } }
OsFamily { public String find(String os) { Map<String,String> pos = parse_os(os); for ( String family : osMap.keySet()) { JsonOsFamilyEntry fam = osMap.get(family); if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){ return family + pos.get(OS_VERSION); } } return null; } OsFamily(Configuration conf);  OsFamily(Properties properties); }
OsFamily { public String find(String os) { Map<String,String> pos = parse_os(os); for ( String family : osMap.keySet()) { JsonOsFamilyEntry fam = osMap.get(family); if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){ return family + pos.get(OS_VERSION); } } return null; } OsFamily(Configuration conf);  OsFamily(Properties properties); Set<String> findTypes(String os); String find(String os); String find_family(String os); Set<String> os_list(); boolean isUbuntuFamily(String osType); boolean isSuseFamily(String osType); boolean isRedhatFamily(String osType); boolean isOsInFamily(String osType, String osFamily); Map<String, String> getAliases(); }
OsFamily { public String find(String os) { Map<String,String> pos = parse_os(os); for ( String family : osMap.keySet()) { JsonOsFamilyEntry fam = osMap.get(family); if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){ return family + pos.get(OS_VERSION); } } return null; } OsFamily(Configuration conf);  OsFamily(Properties properties); Set<String> findTypes(String os); String find(String os); String find_family(String os); Set<String> os_list(); boolean isUbuntuFamily(String osType); boolean isSuseFamily(String osType); boolean isRedhatFamily(String osType); boolean isOsInFamily(String osType, String osFamily); Map<String, String> getAliases();  }