use of com.palantir.paxos.persistence.generated.remoting.PaxosAcceptorPersistence.PaxosPromiseProto in project atlasdb by palantir.
the class ProtobufTest method testPaxosPromisePersistence.
@Test
public void testPaxosPromisePersistence() throws Exception {
PaxosPromise expected;
PaxosPromiseProto persisted;
PaxosPromise actual;
expected = PaxosPromise.reject(new PaxosProposalId(3, "unique"));
persisted = PaxosPromises.toProto(expected);
actual = PaxosPromises.fromProto(persisted);
assertEquals(expected, actual);
expected = PaxosPromise.accept(new PaxosProposalId(20, "id"), new PaxosProposalId(6, "fire"), new PaxosValue("me", 5, new byte[] { 8, 8, 100 }));
persisted = PaxosPromises.toProto(expected);
actual = PaxosPromises.fromProto(persisted);
assertEquals(expected, actual);
expected = PaxosPromise.accept(new PaxosProposalId(20, "id"), null, new PaxosValue("me", 5, new byte[] { 8, 8, 100 }));
persisted = PaxosPromises.toProto(expected);
actual = PaxosPromises.fromProto(persisted);
assertEquals(expected, actual);
expected = PaxosPromise.accept(new PaxosProposalId(20, "id"), null, null);
persisted = PaxosPromises.toProto(expected);
actual = PaxosPromises.fromProto(persisted);
assertEquals(expected, actual);
}
Aggregations