Browse files

Fixed ClusterMapper failing test

  • Loading branch information...
1 parent ccce650 commit 7ef6038bbfbfa99099bb31a6a6a5df63743989df @rsumbaly rsumbaly committed Apr 4, 2011
Showing with 13 additions and 5 deletions.
  1. +12 −4 src/java/voldemort/cluster/Cluster.java
  2. +1 −1 test/unit/voldemort/xml/ClusterMapperTest.java
View
16 src/java/voldemort/cluster/Cluster.java
@@ -162,8 +162,12 @@ public boolean equals(Object second) {
}
for(Zone zoneA: this.getZones()) {
- Zone zoneB = secondCluster.getZoneById(zoneA.getId());
-
+ Zone zoneB;
+ try {
+ zoneB = secondCluster.getZoneById(zoneA.getId());
+ } catch(VoldemortException e) {
+ return false;
+ }
if(zoneB == null || zoneB.getProximityList().size() != zoneA.getProximityList().size()) {
return false;
}
@@ -175,8 +179,12 @@ public boolean equals(Object second) {
}
}
for(Node nodeA: this.getNodes()) {
- Node nodeB = secondCluster.getNodeById(nodeA.getId());
-
+ Node nodeB;
+ try {
+ nodeB = secondCluster.getNodeById(nodeA.getId());
+ } catch(VoldemortException e) {
+ return false;
+ }
if(nodeA.getNumberOfPartitions() != nodeB.getNumberOfPartitions()) {
return false;
}
View
2 test/unit/voldemort/xml/ClusterMapperTest.java
@@ -93,7 +93,7 @@ public void testClusterEquals() {
for(int zoneId = 0; zoneId < 3; zoneId++) {
LinkedList<Integer> proximityList = Lists.newLinkedList(zones3.get(zoneId)
.getProximityList());
- Collections.shuffle(proximityList);
+ Collections.reverse(proximityList);
modifiedZones3.add(new Zone(zones3.get(zoneId).getId(), proximityList));
}

0 comments on commit 7ef6038

Please sign in to comment.