Unit tests for EventuallyConsistentMapImpl.
Most functionality is tested here, except for the anti-entropy code.
ONOS-859.
Change-Id: Ib9e83518f8a91d599364106bc0f7d869e62f5133
diff --git a/core/store/dist/src/main/java/org/onosproject/store/impl/EventuallyConsistentMapEvent.java b/core/store/dist/src/main/java/org/onosproject/store/impl/EventuallyConsistentMapEvent.java
index fd38e64..0473abf 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/impl/EventuallyConsistentMapEvent.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/impl/EventuallyConsistentMapEvent.java
@@ -15,6 +15,10 @@
*/
package org.onosproject.store.impl;
+import com.google.common.base.MoreObjects;
+
+import java.util.Objects;
+
/**
* Event object signalling that the map was modified.
*/
@@ -68,4 +72,30 @@
public V value() {
return value;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof EventuallyConsistentMapEvent)) {
+ return false;
+ }
+
+ EventuallyConsistentMapEvent that = (EventuallyConsistentMapEvent) o;
+ return Objects.equals(this.type, that.type) &&
+ Objects.equals(this.key, that.key) &&
+ Objects.equals(this.value, that.value);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(type, key, value);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass())
+ .add("type", type)
+ .add("key", key)
+ .add("value", value)
+ .toString();
+ }
}