Queue yang model
[controller.git] / opendaylight / hosttracker / implementation / src / test / java / org / opendaylight / controller / hosttracker / internal / HostTrackerTest.java
index 9bd28c8e45315a5c7be43ad08a62909612004291..dc15f96f6efadb2f727f1a469cbb59d9a921f1b9 100644 (file)
@@ -1,4 +1,3 @@
-\r
 /*\r
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
  *\r
@@ -9,51 +8,45 @@
 \r
 package org.opendaylight.controller.hosttracker.internal;\r
 \r
-\r
 import java.net.InetAddress;\r
 import java.net.UnknownHostException;\r
-import java.util.concurrent.Future;\r
+import junit.framework.TestCase;\r
 \r
 import org.junit.Assert;\r
 import org.junit.Test;\r
 \r
-import junit.framework.TestCase;\r
-import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;\r
-\r
 public class HostTrackerTest extends TestCase {\r
 \r
-       @Test\r
-       public void testHostTrackerCallable() throws UnknownHostException {\r
-               \r
-               HostTracker hostTracker = null;\r
-               hostTracker = new HostTracker();\r
-               Assert.assertFalse(hostTracker== null);\r
-               \r
-               InetAddress hostIP = InetAddress.getByName("192.168.0.8");\r
-               \r
-               HostTrackerCallable htCallable = new HostTrackerCallable (hostTracker, hostIP);\r
-               Assert.assertTrue(htCallable.trackedHost.equals(hostIP));\r
-               Assert.assertTrue(htCallable.hostTracker.equals(hostTracker));\r
-\r
-               long count = htCallable.latch.getCount();\r
-               htCallable.wakeup();\r
-               Assert.assertTrue(htCallable.latch.getCount() == --count );\r
-       }               \r
-               \r
-       \r
-       \r
-       @Test\r
-       public void testHostTracker() throws UnknownHostException {\r
-               HostTracker hostTracker = null;\r
-               hostTracker = new HostTracker();\r
-               Assert.assertFalse(hostTracker== null);\r
-               \r
-               InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
-               InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18");\r
-               Future<HostNodeConnector> dschost = hostTracker.discoverHost(hostIP_1);\r
-               dschost = hostTracker.discoverHost(hostIP_2);\r
-               hostTracker.nonClusterObjectCreate();\r
-       }\r
-       \r
+    @Test\r
+    public void testHostTrackerCallable() throws UnknownHostException {\r
+\r
+        HostTracker hostTracker = null;\r
+        hostTracker = new HostTracker();\r
+        Assert.assertFalse(hostTracker == null);\r
+\r
+        InetAddress hostIP = InetAddress.getByName("192.168.0.8");\r
+\r
+        HostTrackerCallable htCallable = new HostTrackerCallable(hostTracker,\r
+                hostIP);\r
+        Assert.assertTrue(htCallable.trackedHost.equals(hostIP));\r
+        Assert.assertTrue(htCallable.hostTracker.equals(hostTracker));\r
+\r
+        long count = htCallable.latch.getCount();\r
+        htCallable.wakeup();\r
+        Assert.assertTrue(htCallable.latch.getCount() == (count - 1));\r
+    }\r
+\r
+    @Test\r
+    public void testHostTracker() throws UnknownHostException {\r
+        HostTracker hostTracker = null;\r
+        hostTracker = new HostTracker();\r
+        Assert.assertFalse(hostTracker == null);\r
+\r
+        InetAddress hostIP_1 = InetAddress.getByName("192.168.0.8");\r
+        InetAddress hostIP_2 = InetAddress.getByName("192.168.0.18");\r
+        hostTracker.discoverHost(hostIP_1);\r
+        hostTracker.discoverHost(hostIP_2);\r
+        hostTracker.nonClusterObjectCreate();\r
+    }\r
 \r
 }\r