Merge "Add assertNotNull to prevent null analysis warnings"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 21 Apr 2015 10:41:20 +0000 (10:41 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 21 Apr 2015 10:41:21 +0000 (10:41 +0000)
1  2 
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java

index 37e7d35d434ce0b42f2509a35322bc6acc40d09b,d60a9de0fd3b1c153c2533d575d1c3bcc0ec2e74..e5c8677b0466fa0b282a413ef2291dd0318ce01e
@@@ -472,6 -472,7 +472,7 @@@ public class RaftActorTest extends Abst
                  Uninterruptibles.sleepUninterruptibly(heartBeatInterval, TimeUnit.MILLISECONDS);
              }
  
+             assertNotNull(matches);
              assertEquals(2, matches.size());
  
              // check if the notifier got a role change from null to Follower
                          new MockRaftActorContext.MockPayload("foo-3"),
                          new MockRaftActorContext.MockPayload("foo-4")));
  
 -                leaderActor.getRaftActorContext().getSnapshotManager().persist(new NonPersistentDataProvider()
 -                        , snapshotBytes.toByteArray(), leader, Runtime.getRuntime().totalMemory());
 +                leaderActor.getRaftActorContext().getSnapshotManager().persist(snapshotBytes.toByteArray(),
 +                        leader, Runtime.getRuntime().totalMemory());
  
                  assertFalse(leaderActor.getRaftActorContext().getSnapshotManager().isCapturing());
  
                  // The commit is needed to complete the snapshot creation process
 -                leaderActor.getRaftActorContext().getSnapshotManager().commit(new NonPersistentDataProvider(), -1);
 +                leaderActor.getRaftActorContext().getSnapshotManager().commit(-1);
  
                  // capture snapshot reply should remove the snapshotted entries only
                  assertEquals(3, leaderActor.getReplicatedLog().size());
                  assertFalse(followerActor.getRaftActorContext().getSnapshotManager().isCapturing());
  
                  // The commit is needed to complete the snapshot creation process
 -                followerActor.getRaftActorContext().getSnapshotManager().commit(new NonPersistentDataProvider(), -1);
 +                followerActor.getRaftActorContext().getSnapshotManager().commit(-1);
  
                  // capture snapshot reply should remove the snapshotted entries only till replicatedToAllIndex
                  assertEquals(3, followerActor.getReplicatedLog().size()); //indexes 5,6,7 left in the log