@Test public void testGetNonExistentPort() { assertEquals("Non-Existent Port", GetServiceByName.getPort("asdfasdfadsf", "tcp"), -1); }
public static int getPort(String serviceName, String type) { int port = -1; try { if (service == null) { service = new GetServiceByName(); } port = service.getPortByName(serviceName, type); } catch (Exception ignoredByDesign) { ; } return port; }
GetServiceByName { public static int getPort(String serviceName, String type) { int port = -1; try { if (service == null) { service = new GetServiceByName(); } port = service.getPortByName(serviceName, type); } catch (Exception ignoredByDesign) { ; } return port; } }
GetServiceByName { public static int getPort(String serviceName, String type) { int port = -1; try { if (service == null) { service = new GetServiceByName(); } port = service.getPortByName(serviceName, type); } catch (Exception ignoredByDesign) { ; } return port; } private  GetServiceByName(); }
GetServiceByName { public static int getPort(String serviceName, String type) { int port = -1; try { if (service == null) { service = new GetServiceByName(); } port = service.getPortByName(serviceName, type); } catch (Exception ignoredByDesign) { ; } return port; } private  GetServiceByName(); static int getPort(String serviceName, String type); static int getPort(String serviceName); }
GetServiceByName { public static int getPort(String serviceName, String type) { int port = -1; try { if (service == null) { service = new GetServiceByName(); } port = service.getPortByName(serviceName, type); } catch (Exception ignoredByDesign) { ; } return port; } private  GetServiceByName(); static int getPort(String serviceName, String type); static int getPort(String serviceName);  }