Unit tests for PartitionManager
Change-Id: I721ed6489ce19cb78ce9e2f150dfed90882f3b0e
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java
index 72590aa..36475b8 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/PartitionManager.java
@@ -57,7 +57,7 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ClusterService clusterService;
- private static final int NUM_PARTITIONS = 14;
+ static final int NUM_PARTITIONS = 14;
private static final int BACKOFF_TIME = 2;
private static final int CHECK_PERIOD = 10;
@@ -90,6 +90,17 @@
clusterService.removeListener(clusterListener);
}
+ /**
+ * Sets the specified executor to be used for scheduling background tasks.
+ *
+ * @param executor scheduled executor service for background tasks
+ * @return this PartitionManager
+ */
+ public PartitionManager withScheduledExecutor(ScheduledExecutorService executor) {
+ this.executor = executor;
+ return this;
+ }
+
private String getPartitionPath(int i) {
return ELECTION_PREFIX + i;
}