use of org.apache.geode.internal.util.HostName in project geode by apache.
the class HostNameTest method shouldBeNullIfEnvValueNotAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldBeNullIfEnvValueNotAvailableOnOS(String osName) throws IOException {
setHostNamePropertiesNull(osName);
String result = new HostName().getHostNameFromEnv();
assertThat(result).isEqualTo(null);
}
use of org.apache.geode.internal.util.HostName in project geode by apache.
the class HostNameTest method shouldUseComputerNameIfAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldUseComputerNameIfAvailableOnOS(String osName) throws IOException {
setHostNameProperties(osName);
String result = new HostName().determineHostName();
assertThat(result).isEqualTo(EXPECTED_HOSTNAME);
}
use of org.apache.geode.internal.util.HostName in project geode by apache.
the class HostNameTest method shouldExecHostNameIfEnvValueNotAvailableOnOS.
@Test
@Parameters({ MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME })
public void shouldExecHostNameIfEnvValueNotAvailableOnOS(String osName) throws IOException {
setHostNamePropertiesNull(osName);
String result = new HostName().determineHostName();
assertThat(result).isNotNull();
}
use of org.apache.geode.internal.util.HostName in project geode by apache.
the class HostNameTest method execHostNameShouldNeverReturnNull.
@Test
public void execHostNameShouldNeverReturnNull() throws IOException {
String result = new HostName().execHostName();
assertThat(result).isNotNull();
}
Aggregations