@Test public void testGetHostname1() { try { InetAddress address = mock(InetAddress.class); when(address.getCanonicalHostName()).thenReturn("worker10"); when(address.getHostName()).thenReturn("worker10"); when(address.getHostAddress()).thenReturn("127.0.0.1"); TaskManagerLocation info = new TaskManagerLocation(ResourceID.generate(), address, 19871); Assert.assertEquals("worker10", info.getHostname()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
public String getHostname() { return hostName; }
TaskManagerLocation implements Comparable<TaskManagerLocation>, java.io.Serializable { public String getHostname() { return hostName; } }
TaskManagerLocation implements Comparable<TaskManagerLocation>, java.io.Serializable { public String getHostname() { return hostName; } TaskManagerLocation(ResourceID resourceID, InetAddress inetAddress, int dataPort); }
TaskManagerLocation implements Comparable<TaskManagerLocation>, java.io.Serializable { public String getHostname() { return hostName; } TaskManagerLocation(ResourceID resourceID, InetAddress inetAddress, int dataPort); ResourceID getResourceID(); int dataPort(); InetAddress address(); String addressString(); String getFQDNHostname(); String getHostname(); static String getHostName(InetAddress inetAddress); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(@Nonnull TaskManagerLocation o); }
TaskManagerLocation implements Comparable<TaskManagerLocation>, java.io.Serializable { public String getHostname() { return hostName; } TaskManagerLocation(ResourceID resourceID, InetAddress inetAddress, int dataPort); ResourceID getResourceID(); int dataPort(); InetAddress address(); String addressString(); String getFQDNHostname(); String getHostname(); static String getHostName(InetAddress inetAddress); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(@Nonnull TaskManagerLocation o);  }