Permalink
Browse files

contrib tests fixed.

  • Loading branch information...
1 parent 172d42a commit d7c1ce76b1ff466e72af682ff3d540145a011087 @bbansal bbansal committed Mar 12, 2009
@@ -116,16 +116,18 @@ public void testswap() throws Throwable {
for(int i = 1; i < 1000; i++) {
ByteArray key = new ByteArray(serializer.toBytes("key" + i));
- byte[] value = serializer.toBytes("value" + i);
+ byte[] value = serializer.toBytes("value-" + i);
assertEquals("either store1 or store2 will have the key:'key-" + i + "'",
true,
store1.get(key).size() > 0 || store2.get(key).size() > 0);
assertEquals("value should match",
- value,
- (store1.get(key).size() > 0) ? store1.get(key).get(0) : store2.get(key)
- .get(0));
+ new String(value),
+ new String((store1.get(key).size() > 0) ? store1.get(key)
+ .get(0)
+ .getValue()
+ : store2.get(key).get(0).getValue()));
}
// lets create new index files
@@ -109,15 +109,17 @@ public void testswap() throws Throwable {
for(int i = 1; i < 1000; i++) {
ByteArray key = new ByteArray(serializer.toBytes("key" + i));
- byte[] value = serializer.toBytes("value" + i);
+ byte[] value = serializer.toBytes("value-" + i);
assertEquals("either store1 or store2 will have the key:'key-" + i + "'",
true,
store1.get(key).size() > 0 || store2.get(key).size() > 0);
assertEquals("value should match",
- value,
- (store1.get(key).size() > 0) ? store1.get(key).get(0) : store2.get(key)
- .get(0));
+ new String(value),
+ new String((store1.get(key).size() > 0) ? store1.get(key)
+ .get(0)
+ .getValue()
+ : store2.get(key).get(0).getValue()));
}
// lets create new index files
@@ -165,14 +167,16 @@ public boolean copyRemoteFile(String hostname, String source, String destination
for(int i = 2000; i < 3000; i++) {
ByteArray key = new ByteArray(serializer.toBytes("key" + i));
- byte[] value = serializer.toBytes("value" + i);
+ byte[] value = serializer.toBytes("value-" + i);
assertEquals("either store1 or store2 will have the key:'key-" + i + "'",
true,
store1.get(key).size() > 0 || store2.get(key).size() > 0);
assertEquals("value should match",
- value,
- (store1.get(key).size() > 0) ? store1.get(key).get(0) : store2.get(key)
- .get(0));
+ new String(value),
+ new String((store1.get(key).size() > 0) ? store1.get(key)
+ .get(0)
+ .getValue()
+ : store2.get(key).get(0).getValue()));
}
}

0 comments on commit d7c1ce7

Please sign in to comment.