You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2012/03/26 17:52:05 UTC
[4/4] git commit: cleanup
cleanup
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/95976418
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/95976418
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/95976418
Branch: refs/heads/cassandra-1.0
Commit: 959764186ac64e450d7f5566070da32e1b567146
Parents: 1e18538
Author: Jonathan Ellis <jb...@gmail.com>
Authored: Mon Mar 26 09:59:37 2012 -0500
Committer: Jonathan Ellis <jb...@gmail.com>
Committed: Mon Mar 26 10:51:43 2012 -0500
----------------------------------------------------------------------
.../cassandra/service/SerializationsTest.java | 16 ++++++--------
1 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/95976418/test/unit/org/apache/cassandra/service/SerializationsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/service/SerializationsTest.java b/test/unit/org/apache/cassandra/service/SerializationsTest.java
index 710e0ec..b13bf7f 100644
--- a/test/unit/org/apache/cassandra/service/SerializationsTest.java
+++ b/test/unit/org/apache/cassandra/service/SerializationsTest.java
@@ -63,20 +63,18 @@ public class SerializationsTest extends AbstractSerializationsTester
assert messageSerializer.deserialize(in, getVersion()) != null;
in.close();
}
-
private void testTreeResponseWrite() throws IOException
{
+ // empty validation
AntiEntropyService.Validator v0 = new AntiEntropyService.Validator(Statics.req);
- IPartitioner part = new RandomPartitioner();
- MerkleTree mt = new MerkleTree(part, FULL_RANGE, MerkleTree.RECOMMENDED_DEPTH, Integer.MAX_VALUE);
- List<Token> tokens = new ArrayList<Token>();
+
+ // validation with a tree
+ IPartitioner p = new RandomPartitioner();
+ MerkleTree mt = new MerkleTree(p, FULL_RANGE, MerkleTree.RECOMMENDED_DEPTH, Integer.MAX_VALUE);
for (int i = 0; i < 10; i++)
- {
- Token t = part.getRandomToken();
- tokens.add(t);
- mt.split(t);
- }
+ mt.split(p.getRandomToken());
AntiEntropyService.Validator v1 = new AntiEntropyService.Validator(Statics.req, mt);
+
DataOutputStream out = getOutput("service.TreeResponse.bin");
AntiEntropyService.TreeResponseVerbHandler.SERIALIZER.serialize(v0, out, getVersion());
AntiEntropyService.TreeResponseVerbHandler.SERIALIZER.serialize(v1, out, getVersion());