use of org.opendaylight.controller.cluster.raft.MockRaftActorContext.MockPayload in project controller by opendaylight.
the class SnapshotTest method testSerialization.
@Test
public void testSerialization() {
testSerialization(new byte[] { 1, 2, 3, 4, 5, 6, 7 }, Arrays.asList(new SimpleReplicatedLogEntry(6, 2, new MockPayload("payload"))));
testSerialization(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, Collections.emptyList());
}
use of org.opendaylight.controller.cluster.raft.MockRaftActorContext.MockPayload in project controller by opendaylight.
the class AppendEntriesTest method testSerialization.
@Test
public void testSerialization() {
ReplicatedLogEntry entry1 = new SimpleReplicatedLogEntry(1, 2, new MockPayload("payload1"));
ReplicatedLogEntry entry2 = new SimpleReplicatedLogEntry(3, 4, new MockPayload("payload2"));
short payloadVersion = 5;
AppendEntries expected = new AppendEntries(5L, "node1", 7L, 8L, Arrays.asList(entry1, entry2), 10L, -1, payloadVersion);
AppendEntries cloned = (AppendEntries) SerializationUtils.clone(expected);
verifyAppendEntries(expected, cloned);
}
Aggregations