/* wait until everything's up and running...
*/
Thread.sleep( 200 );
final Response response1 = get( _httpClient, _portTomcat1, null );
final String sessionId1 = response1.getSessionId();
assertNotNull( sessionId1 );
assertEquals( extractNodeId( sessionId1 ), _nodeId1 );
/* reconfigure tomcat with only third memcached nodes and stop
* the first one
*/
final String memcachedNodes2 = toString( _nodeId1, _address1 ) +
" " + toString( _nodeId2, _address2 ) +
" " + toString( _nodeId3, _address3 );
_tomcat1.getManager().setMemcachedNodes( memcachedNodes2 );
_daemon1.stop();
Thread.sleep( 1000 );
/* Expect relocation to node3
*/
final Response response2 = get( _httpClient, _portTomcat1, sessionId1 );
assertNotSame( response2.getSessionId(), sessionId1 );
final String sessionId2 = response2.getResponseSessionId();
assertNotNull( sessionId2 );
assertEquals( extractNodeId( sessionId2 ), _nodeId3 );
}