fixes for RoleValue serialization
Change-Id: Ie51d0e16a0623061790523920f6a22aa18e74517
diff --git a/core/store/hz/cluster/src/test/java/org/onlab/onos/store/mastership/impl/DistributedMastershipStoreTest.java b/core/store/hz/cluster/src/test/java/org/onlab/onos/store/mastership/impl/DistributedMastershipStoreTest.java
index 6435c11..956b0be 100644
--- a/core/store/hz/cluster/src/test/java/org/onlab/onos/store/mastership/impl/DistributedMastershipStoreTest.java
+++ b/core/store/hz/cluster/src/test/java/org/onlab/onos/store/mastership/impl/DistributedMastershipStoreTest.java
@@ -116,7 +116,6 @@
testStore.put(DID1, N1, true, false, false);
testStore.put(DID2, N1, true, false, false);
testStore.put(DID3, N2, true, false, false);
-
assertEquals("wrong devices",
Sets.newHashSet(DID1, DID2), dms.getDevices(N1));
}
@@ -244,7 +243,6 @@
RoleValue rv = dms.roleMap.get(dev);
if (rv == null) {
rv = new RoleValue();
- dms.roleMap.put(dev, rv);
}
if (master) {
@@ -259,6 +257,7 @@
if (term) {
dms.terms.put(dev, 0);
}
+ dms.roleMap.put(dev, rv);
}
//a dumb utility function.
@@ -266,9 +265,9 @@
for (Map.Entry<DeviceId, RoleValue> el : dms.roleMap.entrySet()) {
System.out.println("DID: " + el.getKey());
for (MastershipRole role : MastershipRole.values()) {
- System.out.println(role.toString() + ":");
+ System.out.println("\t" + role.toString() + ":");
for (NodeId n : el.getValue().nodesOfRole(role)) {
- System.out.println("\t" + n);
+ System.out.println("\t\t" + n);
}
}
}