Log.log("Basic nodemap test of Consistent Hashing cluster model");
ConsistentHashCluster model = (ConsistentHashCluster) newProviderInstance();
assertNotNull(model, "model should not be null");
ClusterSpec spec = model.getSpec();
assertNotNull(spec, "spec should not be null");
ConsistentHashCluster.NodeMap nodeMap = model.getNodeMap();
assertNotNull(nodeMap, "node map should not be null");
Collection<ClusterNodeSpec> nodes = nodeMap.values();
assertNotNull(nodes, "value set of node map should not be null");
// regardless of what hash (key) they are mapped to,
// we expected the value set of NodeMap to contain each and every
// ClusterNodeSpec in the ClusterSpec of the model
//
Log.log("NOTE: %d nodes", spec.getNodeSpecs().size());
Log.log("NOTE: size of value set is %d ", nodes.size());
int missCnt = 0;
for(ClusterNodeSpec node : spec.getNodeSpecs()){
if(!nodes.contains(node)){
missCnt ++;
}
// assertTrue(nodes.contains(node), "nodeSpec should be in the value set of NodeMap: " + node);
}