use of com.palantir.paxos.PaxosProposal in project atlasdb by palantir.
the class LeaderRemotingTest method testAccept.
@Test
public void testAccept() throws IOException {
PaxosProposalId id = new PaxosProposalId(123123, UUID.randomUUID().toString());
PaxosProposal paxosProposal = new PaxosProposal(id, new PaxosValue(id.getProposerUUID(), 0, new byte[] { 0, 1, 2, 4, 1 }));
PaxosAcceptor accept = AtlasDbFeignTargetFactory.createProxy(Optional.empty(), acceptor.baseUri().toString(), PaxosAcceptor.class, UserAgents.DEFAULT_USER_AGENT);
accept.accept(0, paxosProposal);
accept.getLatestSequencePreparedOrAccepted();
accept.prepare(0, id);
accept.prepare(1, id);
}
use of com.palantir.paxos.PaxosProposal in project atlasdb by palantir.
the class ProtobufTest method testPaxosProposalPersistence.
@Test
public void testPaxosProposalPersistence() throws Exception {
PaxosProposal expected;
PaxosAcceptorPersistence.PaxosProposal persisted;
PaxosProposal actual;
expected = new PaxosProposal(new PaxosProposalId(55, "nonce"), new PaxosValue("red leader", 93, null));
persisted = expected.persistToProto();
actual = PaxosProposal.hydrateFromProto(persisted);
assertEquals(expected, actual);
expected = new PaxosProposal(new PaxosProposalId(0, "noice"), new PaxosValue("", 93, new byte[] {}));
persisted = expected.persistToProto();
actual = PaxosProposal.hydrateFromProto(persisted);
assertEquals(expected, actual);
}
Aggregations