Jonathan Hart

Remove InetAddress.getLocalHost() calls from OSPF tests.

This is an external dependency because it relies on DNS resolving localhost.

Change-Id: I1f8aa481b2173a166334c8a7bffb60647c666e12
......@@ -21,7 +21,6 @@ import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip6Address;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
......@@ -127,10 +126,10 @@ public class OspfDeviceTedImplTest {
/**
* Tests ipv6RouterIds() getter method.
*/
@Test(expected = Exception.class)
@Test
public void testIpv6RouterIds() throws Exception {
List list = new ArrayList();
list.add(Ip6Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip6Address.valueOf(1));
ospfDeviceTed.setIpv6RouterIds(list);
assertThat(ospfDeviceTed.ipv6RouterIds().size(), is(1));
}
......@@ -138,11 +137,11 @@ public class OspfDeviceTedImplTest {
/**
* Tests ipv6RouterIds() setter method.
*/
@Test(expected = Exception.class)
@Test
public void testSetIpv6RouterIds() throws Exception {
List list = new ArrayList();
list.add(Ip6Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip6Address.valueOf(1));
ospfDeviceTed.setIpv6RouterIds(list);
assertThat(ospfDeviceTed.ipv6RouterIds().size(), is(1));
}
}
\ No newline at end of file
}
......
......@@ -21,7 +21,6 @@ import org.junit.Test;
import org.onlab.packet.Ip4Address;
import org.onlab.util.Bandwidth;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
......@@ -90,7 +89,7 @@ public class OspfLinkTedImplTest {
@Test
public void testIpv4RemRouterId() throws Exception {
List list = new ArrayList();
list.add(Ip4Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip4Address.valueOf(1));
ospfLinkTed.setIpv4RemRouterId(list);
assertThat(ospfLinkTed.ipv4RemRouterId().size(), is(1));
}
......@@ -101,7 +100,7 @@ public class OspfLinkTedImplTest {
@Test
public void testSetIpv4RemRouterId() throws Exception {
List list = new ArrayList();
list.add(Ip4Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip4Address.valueOf(1));
ospfLinkTed.setIpv4RemRouterId(list);
assertThat(ospfLinkTed.ipv4RemRouterId().size(), is(1));
}
......@@ -132,7 +131,7 @@ public class OspfLinkTedImplTest {
@Test
public void testIpv4LocRouterId() throws Exception {
List list = new ArrayList();
list.add(Ip4Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip4Address.valueOf(1));
ospfLinkTed.setIpv4LocRouterId(list);
assertThat(ospfLinkTed.ipv4LocRouterId().size(), is(1));
}
......@@ -143,7 +142,7 @@ public class OspfLinkTedImplTest {
@Test
public void testSetIpv4LocRouterId() throws Exception {
List list = new ArrayList();
list.add(Ip4Address.valueOf(InetAddress.getLocalHost()));
list.add(Ip4Address.valueOf(1));
ospfLinkTed.setIpv4LocRouterId(list);
assertThat(ospfLinkTed.ipv4LocRouterId().size(), is(1));
}
......@@ -201,4 +200,4 @@ public class OspfLinkTedImplTest {
ospfLinkTed.setMaxUnResBandwidth(Bandwidth.bps(1234.0));
assertThat(ospfLinkTed.maxUnResBandwidth(), is(notNullValue()));
}
}
\ No newline at end of file
}
......