X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fhosttracker%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Finternal%2FHostTrackerTest.java;h=9bd28c8e45315a5c7be43ad08a62909612004291;hp=a99100b2956762fcefd4e92d891d25585b5bf3e0;hb=refs%2Fchanges%2F49%2F449%2F1;hpb=541d0a36997f292bb037a2199463431eee538358 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 a99100b295..9bd28c8e45 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 @@ -22,38 +22,38 @@ import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector; public class HostTrackerTest extends TestCase { - @Test - public void testHostTrackerCallable() throws UnknownHostException { - - HostTracker hostTracker = null; - hostTracker = new HostTracker(); - Assert.assertFalse(hostTracker== null); - - InetAddress hostIP = InetAddress.getByName("192.168.0.8"); - - HostTrackerCallable htCallable = new HostTrackerCallable (hostTracker, hostIP); - Assert.assertTrue(htCallable.trackedHost.equals(hostIP)); - Assert.assertTrue(htCallable.hostTracker.equals(hostTracker)); - - long count = htCallable.latch.getCount(); - htCallable.wakeup(); - Assert.assertTrue(htCallable.latch.getCount() == --count ); - } - - - - @Test - public void testHostTracker() throws UnknownHostException { - HostTracker hostTracker = null; - hostTracker = new HostTracker(); - Assert.assertFalse(hostTracker== null); - - InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8"); - InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18"); - Future dschost = hostTracker.discoverHost(hostIP_1); - dschost = hostTracker.discoverHost(hostIP_2); - hostTracker.nonClusterObjectCreate(); - } - + @Test + public void testHostTrackerCallable() throws UnknownHostException { + + HostTracker hostTracker = null; + hostTracker = new HostTracker(); + Assert.assertFalse(hostTracker== null); + + InetAddress hostIP = InetAddress.getByName("192.168.0.8"); + + HostTrackerCallable htCallable = new HostTrackerCallable (hostTracker, hostIP); + Assert.assertTrue(htCallable.trackedHost.equals(hostIP)); + Assert.assertTrue(htCallable.hostTracker.equals(hostTracker)); + + long count = htCallable.latch.getCount(); + htCallable.wakeup(); + Assert.assertTrue(htCallable.latch.getCount() == --count ); + } + + + + @Test + public void testHostTracker() throws UnknownHostException { + HostTracker hostTracker = null; + hostTracker = new HostTracker(); + Assert.assertFalse(hostTracker== null); + + InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8"); + InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18"); + Future dschost = hostTracker.discoverHost(hostIP_1); + dschost = hostTracker.discoverHost(hostIP_2); + hostTracker.nonClusterObjectCreate(); + } + }