use of com.intel.mtwilson.util.net.Hostname in project OpenAttestation by OpenAttestation.
the class HostnameTest method testGetHostname.
@Test
public void testGetHostname() {
Hostname hostname = new Hostname("hostname");
assertEquals("hostname", hostname.getHostname());
}
use of com.intel.mtwilson.util.net.Hostname in project OpenAttestation by OpenAttestation.
the class HostnameTest method testInvalidHostnameExceptionThrown.
@Test(expected = IllegalArgumentException.class)
public void testInvalidHostnameExceptionThrown() {
Hostname hostname = new Hostname("2,2");
hostname.isValid();
}
use of com.intel.mtwilson.util.net.Hostname in project OpenAttestation by OpenAttestation.
the class HostnameTest method testIsValid.
@Test
public void testIsValid() {
Hostname hostname = new Hostname("hostname");
hostname.isValid();
}
use of com.intel.mtwilson.util.net.Hostname in project OpenAttestation by OpenAttestation.
the class HostnameTest method testToString.
@Test
public void testToString() {
try {
String name = InetAddress.getLocalHost().toString();
Hostname hostname = new Hostname(name);
assertEquals(name, hostname.toString());
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of com.intel.mtwilson.util.net.Hostname in project OpenAttestation by OpenAttestation.
the class HostnameTest method testEquals.
@Test
public void testEquals() {
assertEquals(new Hostname("node1"), new Hostname("node1"));
assertEquals(new Hostname("null"), new Hostname("null"));
Hostname hostname1 = new Hostname("hostname1");
Hostname hostname2 = new Hostname("hostname2");
Assert.assertFalse("The two obejct is not equal!", hostname1.equals(hostname2));
}
Aggregations