LeadershipStore updates:
- Now tracking leader and candidates for a topic using a single map.
- Using term numbers that are incremented by one every time a new leader is elected.
- Introduced a separate LeadershipStore to conform to the manager-store pattern
Change-Id: I1d03a6c5e8ff0e68ef0c1e3a6c2d425c4856e470
diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/IntentSynchronizerTest.java b/apps/routing/src/test/java/org/onosproject/routing/impl/IntentSynchronizerTest.java
index d265323..351a099 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/impl/IntentSynchronizerTest.java
+++ b/apps/routing/src/test/java/org/onosproject/routing/impl/IntentSynchronizerTest.java
@@ -17,6 +17,7 @@
import com.google.common.collect.Sets;
import com.google.common.util.concurrent.MoreExecutors;
+
import org.junit.Before;
import org.junit.Test;
import org.onlab.junit.TestUtils;
@@ -29,7 +30,11 @@
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.TestApplicationId;
+import org.onosproject.cluster.ClusterServiceAdapter;
+import org.onosproject.cluster.ControllerNode;
+import org.onosproject.cluster.DefaultControllerNode;
import org.onosproject.cluster.LeadershipServiceAdapter;
+import org.onosproject.cluster.NodeId;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreServiceAdapter;
import org.onosproject.incubator.net.intf.Interface;
@@ -94,6 +99,9 @@
private static final ApplicationId APPID =
TestApplicationId.create("intent-sync-test");
+ private static final ControllerNode LOCAL_NODE =
+ new DefaultControllerNode(new NodeId("foo"), IpAddress.valueOf("127.0.0.1"));
+
@Before
public void setUp() throws Exception {
super.setUp();
@@ -105,6 +113,7 @@
intentSynchronizer = new TestIntentSynchronizer();
intentSynchronizer.coreService = new TestCoreService();
+ intentSynchronizer.clusterService = new TestClusterService();
intentSynchronizer.leadershipService = new TestLeadershipService();
intentSynchronizer.intentService = intentService;
@@ -441,6 +450,13 @@
}
}
+ private class TestClusterService extends ClusterServiceAdapter {
+ @Override
+ public ControllerNode getLocalNode() {
+ return LOCAL_NODE;
+ }
+ }
+
private class TestLeadershipService extends LeadershipServiceAdapter {
}