Merge pull request #669 from adamtanner/inet-address-test-failure
Replace localhost lookup with static IP to fix test.
This commit is contained in:
commit
d805f22166
|
@ -35,11 +35,11 @@ public class DefaultInetAddressTypeAdapterTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInetAddressSerializationAndDeserialization() throws Exception {
|
public void testInetAddressSerializationAndDeserialization() throws Exception {
|
||||||
InetAddress localhost = InetAddress.getLocalHost();
|
InetAddress address = InetAddress.getByName("8.8.8.8");
|
||||||
String localInetAddress = gson.toJson(localhost);
|
String jsonAddress = gson.toJson(address);
|
||||||
assertEquals("\"" + localhost.getHostAddress() + "\"", localInetAddress);
|
assertEquals("\"8.8.8.8\"", jsonAddress);
|
||||||
|
|
||||||
InetAddress value = gson.fromJson(localInetAddress, InetAddress.class);
|
InetAddress value = gson.fromJson(jsonAddress, InetAddress.class);
|
||||||
assertEquals(localhost, value);
|
assertEquals(value, address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user