Skip to content

Commit

Permalink
Remove obsolete tests for removetoken
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.8@1151587 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
driftx committed Jul 27, 2011
1 parent 3ac8f2f commit d033b1f
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions test/unit/org/apache/cassandra/service/RemoveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,44 +154,6 @@ public void run()
assertTrue(tmd.getLeavingEndpoints().isEmpty());
}

@Test
public void testStartRemoving()
{
IPartitioner partitioner = StorageService.getPartitioner();
VersionedValue.VersionedValueFactory valueFactory = new VersionedValue.VersionedValueFactory(partitioner);

NotificationSink nSink = new NotificationSink();
ReplicationSink rSink = new ReplicationSink();
SinkManager.add(nSink);
SinkManager.add(rSink);

assertEquals(0, tmd.getLeavingEndpoints().size());

ss.onChange(hosts.get(1),
ApplicationState.STATUS,
valueFactory.removingNonlocal(endpointTokens.get(1), removaltoken));

assertEquals(1, nSink.callCount);
assertTrue(tmd.isLeaving(removalhost));
assertEquals(1, tmd.getLeavingEndpoints().size());
}

@Test
public void testFinishRemoving()
{
IPartitioner partitioner = StorageService.getPartitioner();
VersionedValue.VersionedValueFactory valueFactory = new VersionedValue.VersionedValueFactory(partitioner);

assertEquals(0, tmd.getLeavingEndpoints().size());

ss.onChange(hosts.get(1),
ApplicationState.STATUS,
valueFactory.removedNonlocal(endpointTokens.get(1), removaltoken));

assertFalse(Gossiper.instance.getLiveMembers().contains(removalhost));
assertFalse(tmd.isMember(removalhost));
}

class ReplicationSink implements IMessageSink
{
public Message handleMessage(Message msg, String id, InetAddress to)
Expand All @@ -205,25 +167,4 @@ public Message handleMessage(Message msg, String id, InetAddress to)
}
}

class NotificationSink implements IMessageSink
{
public int callCount = 0;

public Message handleMessage(Message msg, String id, InetAddress to)
{
if (msg.getVerb().equals(StorageService.Verb.REPLICATION_FINISHED))
{
callCount++;
assertEquals(Stage.MISC, msg.getMessageType());
// simulate a response from remote server
Message response = msg.getReply(FBUtilities.getLocalAddress(), new byte[]{ }, msg.getVersion());
MessagingService.instance().sendReply(response, id, FBUtilities.getLocalAddress());
return null;
}
else
{
return msg;
}
}
}
}

0 comments on commit d033b1f

Please sign in to comment.