@Test
public void testRelocateClientSessionSendingDuringRelocate()
throws Exception
{
String newNodeHost = "newNode";
DummyClient client = createClientToRelocate(newNodeHost);
try {
SgsTestNode newNode = additionalNodes.get(newNodeHost);
int objectCount = getObjectCount();
sendMessagesFromNode(serverNode, client, 4, 0);
sendMessagesFromNode(newNode, client, 4, 10);
client.relocate(newNode.getAppPort(), true, true);
synchronized (client.clientReceivedMessages) {
client.waitForClientToReceiveExpectedMessages(4);
client.validateMessageSequence(
client.clientReceivedMessages, 4, 0);
client.clientReceivedMessages.clear();
client.waitForClientToReceiveExpectedMessages(4);
client.validateMessageSequence(
client.clientReceivedMessages, 4, 10);
}
waitForExpectedObjectCount(objectCount);
} finally {
client.disconnect();
}
}