InstallSnapshot does not pass the term to the protobuff instance 72/15272/2
authortpantelis <tpanteli@brocade.com>
Wed, 11 Feb 2015 07:43:28 +0000 (02:43 -0500)
committertpantelis <tpanteli@brocade.com>
Thu, 19 Feb 2015 07:07:54 +0000 (02:07 -0500)
Change-Id: If84d7ddc81fd1ea154477fe9795bba9e748af24c
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java

index 119b43c..13636f3 100644 (file)
@@ -73,6 +73,7 @@ public class InstallSnapshot extends AbstractRaftRPC {
 
     public <T extends Object> Object toSerializable(){
         InstallSnapshotMessages.InstallSnapshot.Builder builder = InstallSnapshotMessages.InstallSnapshot.newBuilder()
+                .setTerm(this.getTerm())
                 .setLeaderId(this.getLeaderId())
                 .setChunkIndex(this.getChunkIndex())
                 .setData(this.getData())
index 7c37cbc..02c391f 100644 (file)
@@ -424,8 +424,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest {
         assertEquals(snapshotIndex, installSnapshot.getLastIncludedIndex());
         assertEquals(snapshotTerm, installSnapshot.getLastIncludedTerm());
 
-        // FIXME - we don't set the term in the serialized message.
-        //assertEquals(currentTerm, installSnapshot.getTerm());
+        assertEquals(currentTerm, installSnapshot.getTerm());
     }
 
     @Test

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.