Search in sources :

Example 1 with HostName

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);
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 2 with HostName

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);
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 3 with 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();
}
Also used : HostName(org.apache.geode.internal.util.HostName) Parameters(junitparams.Parameters) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Example 4 with HostName

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();
}
Also used : HostName(org.apache.geode.internal.util.HostName) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

Aggregations

HostName (org.apache.geode.internal.util.HostName)4 UnitTest (org.apache.geode.test.junit.categories.UnitTest)4 Test (org.junit.Test)4 Parameters (junitparams.Parameters)3