aState.update(cn);
cn = new ChangeNumber(1L, 0, myId2);
aState.update(cn);
cn = new ChangeNumber(1L, 0, myId3);
aState.update(cn);
ReplServerStartMsg replServerStartMsg =
new ReplServerStartMsg(11, LOOSER1, null, 0, aState, (short)0, 0L,
false, (byte)1, 0);
rsInfos.put(11, ReplicationServerInfo.newInstance(replServerStartMsg));
// State for server 2
aState = new ServerState();
cn = new ChangeNumber(2L, 0, myId1);
aState.update(cn);
cn = new ChangeNumber(1L, 0, myId2);
aState.update(cn);
cn = new ChangeNumber(3L, 0, myId3);
aState.update(cn);
replServerStartMsg =
new ReplServerStartMsg(12, LOOSER2, null, 0, aState, (short)0, 0L,
false, (byte)2, 0);
rsInfos.put(12, ReplicationServerInfo.newInstance(replServerStartMsg));
// State for server 3
aState = new ServerState();
cn = new ChangeNumber(3L, 0, myId1);
aState.update(cn);
cn = new ChangeNumber(2L, 0, myId2);
aState.update(cn);
cn = new ChangeNumber(1L, 0, myId3);
aState.update(cn);
// This server has less changes than looser2 but it has the same
// group id as us so he should be the winner
replServerStartMsg =
new ReplServerStartMsg(13, WINNER, null, 0, aState, (short)0, 0L,
false, (byte)1, 0);
rsInfos.put(13, ReplicationServerInfo.newInstance(replServerStartMsg));
ReplicationServerInfo bestServer =
computeBestReplicationServer(true, -1, mySt, rsInfos, myId1, " ", (byte)1, 0L);