X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fhosttracker%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Finternal%2FHostTrackerTest.java;h=d7c60e67a91dfa85213343e41e3f495bacf83e55;hb=3979e330c9f95a898c54a9234f3a07e3b2ae4349;hp=25de544f52e8d0dd79da9afff83e2eda1e28a145;hpb=7c3362df780f30a47d0f6a7b7695360bbb5513bc;p=controller.git diff --git a/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java b/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java index 25de544f52..d7c60e67a9 100644 --- a/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java +++ b/opendaylight/hosttracker/implementation/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerTest.java @@ -10,13 +10,13 @@ package org.opendaylight.controller.hosttracker.internal; import java.net.InetAddress; import java.net.UnknownHostException; -import java.util.concurrent.Future; import junit.framework.TestCase; import org.junit.Assert; import org.junit.Test; -import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector; +import org.opendaylight.controller.hosttracker.IHostId; +import org.opendaylight.controller.hosttracker.IPHostId; public class HostTrackerTest extends TestCase { @@ -28,15 +28,16 @@ public class HostTrackerTest extends TestCase { Assert.assertFalse(hostTracker == null); InetAddress hostIP = InetAddress.getByName("192.168.0.8"); + IHostId id = IPHostId.fromIP(hostIP); HostTrackerCallable htCallable = new HostTrackerCallable(hostTracker, - hostIP); - Assert.assertTrue(htCallable.trackedHost.equals(hostIP)); + id); + Assert.assertTrue(htCallable.trackedHost.equals(id)); Assert.assertTrue(htCallable.hostTracker.equals(hostTracker)); long count = htCallable.latch.getCount(); htCallable.wakeup(); - Assert.assertTrue(htCallable.latch.getCount() == --count); + Assert.assertTrue(htCallable.latch.getCount() == (count - 1)); } @Test @@ -46,9 +47,11 @@ public class HostTrackerTest extends TestCase { Assert.assertFalse(hostTracker == null); InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8"); + IHostId id1 = IPHostId.fromIP(hostIP_1); InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18"); - Future dschost = hostTracker.discoverHost(hostIP_1); - dschost = hostTracker.discoverHost(hostIP_2); + IHostId id2 = IPHostId.fromIP(hostIP_2); + hostTracker.discoverHost(id1); + hostTracker.discoverHost(id2); hostTracker.nonClusterObjectCreate(); }