Fix EventuallyConsistentMapImpl unit tests.
Change-Id: I5d114bac40c16d0f67330ba2b4b922a4301666b2
diff --git a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
index 8c52156..fd05d7f 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/ecmap/EventuallyConsistentMapImpl.java
@@ -85,7 +85,7 @@
private final ScheduledExecutorService backgroundExecutor;
- private final ExecutorService broadcastMessageExecutor;
+ private ExecutorService broadcastMessageExecutor;
private volatile boolean destroyed = false;
private static final String ERROR_DESTROYED = " map is already destroyed";
@@ -188,6 +188,18 @@
};
}
+ /**
+ * Sets the executor to use for broadcasting messages and returns this
+ * instance for method chaining.
+ * @param executor executor service
+ * @return this instance
+ */
+ public EventuallyConsistentMapImpl<K, V> withBroadcastMessageExecutor(ExecutorService executor) {
+ checkNotNull(executor, "Null executor");
+ broadcastMessageExecutor = executor;
+ return this;
+ }
+
@Override
public int size() {
checkState(!destroyed, mapName + ERROR_DESTROYED);