Gracefully stop HT threads when the bundle is being stopped (cache terminated exception)
[controller.git] / opendaylight / hosttracker / implementation / src / test / java / org / opendaylight / controller / hosttracker / internal / HostTrackerTest.java
index 25de544f52e8d0dd79da9afff83e2eda1e28a145..dc15f96f6efadb2f727f1a469cbb59d9a921f1b9 100644 (file)
@@ -10,13 +10,10 @@ package org.opendaylight.controller.hosttracker.internal;
 \r
 import java.net.InetAddress;\r
 import java.net.UnknownHostException;\r
-import java.util.concurrent.Future;\r
-\r
 import junit.framework.TestCase;\r
 \r
 import org.junit.Assert;\r
 import org.junit.Test;\r
-import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;\r
 \r
 public class HostTrackerTest extends TestCase {\r
 \r
@@ -36,7 +33,7 @@ public class HostTrackerTest extends TestCase {
 \r
         long count = htCallable.latch.getCount();\r
         htCallable.wakeup();\r
-        Assert.assertTrue(htCallable.latch.getCount() == --count);\r
+        Assert.assertTrue(htCallable.latch.getCount() == (count - 1));\r
     }\r
 \r
     @Test\r
@@ -47,8 +44,8 @@ public class HostTrackerTest extends TestCase {
 \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.discoverHost(hostIP_1);\r
+        hostTracker.discoverHost(hostIP_2);\r
         hostTracker.nonClusterObjectCreate();\r
     }\r
 \r