X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fhosttracker%2Fintegrationtest%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Finternal%2FHostTrackerIT.java;h=a454eb97e1305b9a5dbec63a0d4c895edc11ccb3;hp=57e2714ff1c23bf3aded4c40d4b98ae96ed0135c;hb=f062dc05cc7caaf0c1811856370f1c9e2f1e5c34;hpb=97fd2a787cccc23c9224d5aa3d2db1c0ee344b67 diff --git a/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIT.java b/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIT.java index 57e2714ff1..a454eb97e1 100644 --- a/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIT.java +++ b/opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIT.java @@ -27,6 +27,8 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.opendaylight.controller.hosttracker.IHostId; +import org.opendaylight.controller.hosttracker.IPHostId; import org.opendaylight.controller.hosttracker.IfIptoHost; import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector; import org.opendaylight.controller.sal.core.Node; @@ -37,7 +39,7 @@ import org.opendaylight.controller.sal.utils.NodeCreator; import org.opendaylight.controller.sal.utils.Status; import org.opendaylight.controller.switchmanager.IInventoryListener; import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.Configuration; +import org.ops4j.pax.exam.Configuration; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.util.PathUtils; import org.osgi.framework.Bundle; @@ -45,6 +47,7 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + //import org.opendaylight.controller.hosttracker.*; @RunWith(PaxExam.class) @@ -56,6 +59,7 @@ public class HostTrackerIT { private IfIptoHost hosttracker = null; private IInventoryListener invtoryListener = null; + // Configure the OSGi container @Configuration public Option[] config() { @@ -92,7 +96,7 @@ public class HostTrackerIT { // needed by statisticsmanager mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(), - mavenBundle("org.opendaylight.controller", "containermanager.implementation").versionAsInProject(), + mavenBundle("org.opendaylight.controller", "containermanager.it.implementation").versionAsInProject(), mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(), mavenBundle("org.opendaylight.controller", "clustering.stub").versionAsInProject(), @@ -218,7 +222,6 @@ public class HostTrackerIT { st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "0"); Assert.assertFalse(st.isSuccess()); - this.invtoryListener.notifyNodeConnector(nc1_1, UpdateType.ADDED, null); // check all host list @@ -257,12 +260,15 @@ public class HostTrackerIT { Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, null); st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, ""); - HostNodeConnector hnc_1 = this.hosttracker.hostFind(InetAddress.getByName("192.168.0.8")); + IHostId id1 = IPHostId.fromIP(InetAddress.getByName("192.168.0.8")); + HostNodeConnector hnc_1 = this.hosttracker.hostFind(id1); assertNull(hnc_1); this.invtoryListener.notifyNodeConnector(nc1_1, UpdateType.ADDED, null); - hnc_1 = this.hosttracker.hostFind(InetAddress.getByName("192.168.0.8")); + IHostId id2 = IPHostId.fromIP(InetAddress.getByName("192.168.0.8")); + hnc_1 = this.hosttracker.hostFind(id2); + assertNotNull(hnc_1); }