diff options
Diffstat (limited to 'framework/src/onos/incubator')
5 files changed, 16 insertions, 45 deletions
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java index 4a42a740..ad5e5d18 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java @@ -39,7 +39,7 @@ public class DomainEdge extends AbstractEdge<DomainVertex> { @Override public int hashCode() { - return 43 * super.hashCode() + Objects.hash(connectPoint); + return 43 * super.hashCode() + connectPoint.hashCode(); } @Override diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java index 90f5eab6..d5994863 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/OpticalLogicId.java @@ -63,7 +63,7 @@ public final class OpticalLogicId { @Override public int hashCode() { - return Objects.hash(logicId); + return Objects.hashCode(logicId); } @Override diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java index 54a22a46..e3339a9a 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java @@ -53,7 +53,7 @@ public class DefaultVirtualDevice extends DefaultDevice implements VirtualDevice @Override public int hashCode() { - return 31 * super.hashCode() + Objects.hash(networkId); + return 31 * super.hashCode() + networkId.hashCode(); } @Override diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/TenantId.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/TenantId.java index a00f8807..196c17d4 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/TenantId.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/TenantId.java @@ -59,7 +59,7 @@ public final class TenantId { @Override public int hashCode() { - return Objects.hash(id); + return id.hashCode(); } @Override diff --git a/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/mcast/impl/MulticastRouteManagerTest.java b/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/mcast/impl/MulticastRouteManagerTest.java index 545e21d0..bec9cded 100644 --- a/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/mcast/impl/MulticastRouteManagerTest.java +++ b/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/mcast/impl/MulticastRouteManagerTest.java @@ -23,10 +23,8 @@ import org.onlab.junit.TestUtils; import org.onlab.packet.IpPrefix; import org.onosproject.common.event.impl.TestEventDispatcher; import org.onosproject.core.ApplicationId; -import org.onosproject.core.CoreService; +import org.onosproject.core.CoreServiceAdapter; import org.onosproject.core.DefaultApplicationId; -import org.onosproject.core.IdGenerator; -import org.onosproject.core.Version; import org.onosproject.net.ConnectPoint; import org.onosproject.net.PortNumber; import org.onosproject.net.mcast.McastEvent; @@ -35,7 +33,6 @@ import org.onosproject.net.mcast.McastRoute; import org.onosproject.store.service.TestStorageService; import java.util.List; -import java.util.Set; import static junit.framework.Assert.fail; import static junit.framework.TestCase.assertEquals; @@ -48,16 +45,16 @@ import static org.onosproject.net.NetTestTools.injectEventDispatcher; public class MulticastRouteManagerTest { McastRoute r1 = new McastRoute(IpPrefix.valueOf("1.1.1.1/8"), - IpPrefix.valueOf("1.1.1.2/8"), - McastRoute.Type.IGMP); + IpPrefix.valueOf("1.1.1.2/8"), + McastRoute.Type.IGMP); McastRoute r11 = new McastRoute(IpPrefix.valueOf("1.1.1.1/8"), - IpPrefix.valueOf("1.1.1.2/8"), - McastRoute.Type.STATIC); + IpPrefix.valueOf("1.1.1.2/8"), + McastRoute.Type.STATIC); McastRoute r2 = new McastRoute(IpPrefix.valueOf("2.2.2.1/8"), - IpPrefix.valueOf("2.2.2.2/8"), - McastRoute.Type.PIM); + IpPrefix.valueOf("2.2.2.2/8"), + McastRoute.Type.PIM); ConnectPoint cp1 = new ConnectPoint(did("1"), PortNumber.portNumber(1)); @@ -75,7 +72,7 @@ public class MulticastRouteManagerTest { injectEventDispatcher(manager, new TestEventDispatcher()); TestUtils.setField(manager, "storageService", new TestStorageService()); TestUtils.setField(manager, "coreService", new TestCoreService()); - events = Lists.newArrayList(); + events = Lists.newArrayList(); manager.activate(); manager.addListener(listener); } @@ -152,49 +149,23 @@ public class MulticastRouteManagerTest { for (int i = 0; i < evs.length; i++) { if (evs[i] != events.get(i).type()) { - fail(String.format("Mismtached events# obtained -> %s : expected %s", + fail(String.format("Mismatched events# obtained -> %s : expected %s", events, evs)); } } } class TestMulticastListener implements McastListener { - @Override public void event(McastEvent event) { events.add(event); } } - private class TestCoreService implements CoreService { - @Override - public Version version() { - return null; - } - - @Override - public Set<ApplicationId> getAppIds() { - return null; - } - - @Override - public ApplicationId getAppId(Short id) { - return null; - } - - @Override - public ApplicationId getAppId(String name) { - return null; - } - - @Override - public ApplicationId registerApplication(String identifier) { - return new DefaultApplicationId(0, identifier); - } - + private class TestCoreService extends CoreServiceAdapter { @Override - public IdGenerator getIdGenerator(String topic) { - return null; + public ApplicationId registerApplication(String name) { + return new DefaultApplicationId(0, name); } } } |