Package org.voltcore.agreement.maker.SiteFailureMessageMaker

Examples of org.voltcore.agreement.maker.SiteFailureMessageMaker.SiteFailureMessage


            with(sfmSafeTxns, sfmSafe(4,44,5,55))
            );

    @Test
    public void testSiteFailureMessageRoundtripSerialization() throws Exception {
        SiteFailureMessage msg = make(sfm);
        assertThat(msg,siteFailureIs(sfmSafe(4,44,5,55),sfmFailed(4,5,6),sfmSurvived(1,2,3)));

        ByteBuffer bb = VoltMessage.toBuffer(msg);

        VoltMessage vmsg = factory.createMessageFromBuffer(bb, 1L);
        assertTrue(vmsg instanceof SiteFailureMessage);

        SiteFailureMessage gsm = (SiteFailureMessage)vmsg;
        assertThat(gsm,siteFailureIs(sfmSafe(4,44,5,55),sfmFailed(4,5,6),sfmSurvived(1,2,3)));
    }
View Full Code Here


    @Test
    public void testSiteFailureMessageRoundtripSerializationWithDecision() throws Exception {
        Set<Long> decision = ImmutableSet.of(1L,2L);

        @SuppressWarnings("unchecked")
        SiteFailureMessage msg = make(sfm.but(with(sfmDecision,decision)));
        assertThat(msg,siteFailureIs(sfmSafe(4,44,5,55),decision,1,2,3));

        ByteBuffer bb = VoltMessage.toBuffer(msg);

        VoltMessage vmsg = factory.createMessageFromBuffer(bb, 1L);
        assertTrue(vmsg instanceof SiteFailureMessage);

        SiteFailureMessage gsm = (SiteFailureMessage)vmsg;
        assertThat(gsm,siteFailureIs(sfmSafe(4,44,5,55),decision,1,2,3));
    }
View Full Code Here

        assertThat(gsm,siteFailureIs(sfmSafe(4,44,5,55),decision,1,2,3));
    }

   @Test
   public void testForwardRoundTripSerialization() throws Exception {
       SiteFailureMessage msg = make(sfm);
       assertThat(msg,siteFailureIs(sfmSafe(4,44,5,55),sfmFailed(4,5,6),sfmSurvived(1,2,3)));

       ByteBuffer bb = VoltMessage.toBuffer(msg);

       VoltMessage vmsg = factory.createMessageFromBuffer(bb, 1L);
       assertTrue(vmsg instanceof SiteFailureMessage);

       SiteFailureMessage gsm = (SiteFailureMessage)vmsg;
       assertThat(gsm,siteFailureIs(sfmSafe(4,44,5,55),sfmFailed(4,5,6),sfmSurvived(1,2,3)));

       SiteFailureForwardMessage fmsg = new SiteFailureForwardMessage(gsm);
       assertThat(fmsg, failureForwardMsgIs(1, sfmSafe(4,44,5,55),sfmFailed(4,5,6),sfmSurvived(1,2,3)));
View Full Code Here

TOP

Related Classes of org.voltcore.agreement.maker.SiteFailureMessageMaker.SiteFailureMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.