protected void doTestWithFailover(boolean enableQJM) throws Exception {
setUp("testWithFailover", enableQJM);
// Create edits before failover.
createEdits(20);
AvatarNode primary = cluster.getPrimaryAvatar(0).avatar;
AvatarNode standby = cluster.getStandbyAvatar(0).avatar;
// SLS + ELS (first checkpoint with no txns) + SLS + 20 edits
assertEquals(23, getCurrentTxId(primary));
// Perform failover and restart old primary.
cluster.failOver(); // shutdown adds ELS (24)
assertEquals(25, getCurrentTxId(cluster.getPrimaryAvatar(0).avatar));
cluster.restartStandby();
// Get new instances after failover.
primary = cluster.getPrimaryAvatar(0).avatar;
standby = cluster.getStandbyAvatar(0).avatar;
// checkpoint by the new standby adds 2 transactions
// standby opens the log with SLS (25)
// new standby checkpoints ELS + SLS
if (!enableQJM) {
// Create some more edits and verify.
createEdits(20);
standby.quiesceStandby(getCurrentTxId(primary)-1);
assertEquals(47, getCurrentTxId(primary));
assertEquals(getCurrentTxId(primary), getCurrentTxId(standby));
}
}