Remove unused exceptions
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / ReplicationAndSnapshotsIntegrationTest.java
index 386108f61529258a13fb91c5f83eac8c41c4d8f3..050b0ddf35d0391a64e47577b391e3d95918a471 100644 (file)
@@ -19,6 +19,8 @@ import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshotRep
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
 import org.opendaylight.controller.cluster.raft.persisted.ApplyJournalEntries;
+import org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry;
+import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
 import org.opendaylight.controller.cluster.raft.persisted.UpdateElectionTerm;
 import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal;
 import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore;
@@ -31,7 +33,7 @@ import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
  */
 public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorIntegrationTest {
 
-    private List<ReplicatedLogImplEntry> origLeaderJournal;
+    private List<SimpleReplicatedLogEntry> origLeaderJournal;
 
     private MockPayload recoveredPayload0;
     private MockPayload recoveredPayload1;
@@ -43,7 +45,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
     private MockPayload payload7;
 
     @Test
-    public void runTest() throws Exception {
+    public void runTest() {
         testLog.info("testReplicationAndSnapshots starting");
 
         // Setup the persistent journal for the leader. We'll start up with 3 journal log entries (one less
@@ -51,14 +53,14 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
         long seqId = 1;
         InMemoryJournal.addEntry(leaderId, seqId++, new UpdateElectionTerm(initialTerm, leaderId));
         recoveredPayload0 = new MockPayload("zero");
-        InMemoryJournal.addEntry(leaderId, seqId++, new ReplicatedLogImplEntry(0, initialTerm, recoveredPayload0));
+        InMemoryJournal.addEntry(leaderId, seqId++, new SimpleReplicatedLogEntry(0, initialTerm, recoveredPayload0));
         recoveredPayload1 = new MockPayload("one");
-        InMemoryJournal.addEntry(leaderId, seqId++, new ReplicatedLogImplEntry(1, initialTerm, recoveredPayload1));
+        InMemoryJournal.addEntry(leaderId, seqId++, new SimpleReplicatedLogEntry(1, initialTerm, recoveredPayload1));
         recoveredPayload2 = new MockPayload("two");
-        InMemoryJournal.addEntry(leaderId, seqId++, new ReplicatedLogImplEntry(2, initialTerm, recoveredPayload2));
+        InMemoryJournal.addEntry(leaderId, seqId++, new SimpleReplicatedLogEntry(2, initialTerm, recoveredPayload2));
         InMemoryJournal.addEntry(leaderId, seqId++, new ApplyJournalEntries(2));
 
-        origLeaderJournal = InMemoryJournal.get(leaderId, ReplicatedLogImplEntry.class);
+        origLeaderJournal = InMemoryJournal.get(leaderId, SimpleReplicatedLogEntry.class);
 
         // Create the leader and 2 follower actors and verify initial syncing of the followers after leader
         // persistence recovery.
@@ -161,7 +163,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
      * scenario, the follower consensus and application of state is delayed until after the snapshot
      * completes.
      */
-    private void testFirstSnapshot() throws Exception {
+    private void testFirstSnapshot() {
         testLog.info("testFirstSnapshot starting");
 
         expSnapshotState.add(recoveredPayload0);
@@ -195,8 +197,8 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
         verifyReplicatedLogEntry(unAppliedEntry.get(0), currentTerm, 3, payload3);
 
         // The leader's persisted journal log should be cleared since we snapshotted.
-        List<ReplicatedLogImplEntry> persistedLeaderJournal =
-                InMemoryJournal.get(leaderId, ReplicatedLogImplEntry.class);
+        List<SimpleReplicatedLogEntry> persistedLeaderJournal =
+                InMemoryJournal.get(leaderId, SimpleReplicatedLogEntry.class);
         assertEquals("Persisted journal log size", 0, persistedLeaderJournal.size());
 
         // Allow AppendEntries to both followers to proceed. This should catch up the followers and cause a
@@ -304,7 +306,7 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
      * Send one more payload to trigger another snapshot. In this scenario, we delay the snapshot until
      * consensus occurs and the leader applies the state.
      */
-    private void testSecondSnapshot() throws Exception {
+    private void testSecondSnapshot() {
         testLog.info("testSecondSnapshot starting");
 
         expSnapshotState.add(payload3);
@@ -368,8 +370,8 @@ public class ReplicationAndSnapshotsIntegrationTest extends AbstractRaftActorInt
         verifyReplicatedLogEntry(unAppliedEntry.get(0), currentTerm, 7, payload7);
 
         // The leader's persisted journal log should be cleared since we did a snapshot.
-        List<ReplicatedLogImplEntry> persistedLeaderJournal = InMemoryJournal.get(
-                leaderId, ReplicatedLogImplEntry.class);
+        List<SimpleReplicatedLogEntry> persistedLeaderJournal = InMemoryJournal.get(
+                leaderId, SimpleReplicatedLogEntry.class);
         assertEquals("Persisted journal log size", 0, persistedLeaderJournal.size());
 
         // Verify the followers apply all 4 new log entries.