Package org.jgroups.protocols.pbcast

Examples of org.jgroups.protocols.pbcast.Digest$Entry


        d.add(a2, 25, 26, 26);
        d.add(a3, 20, 25, 33);
    }

    public void testSize() {
        d2=new Digest(3);
        assertEquals(0, d2.size());
    }
View Full Code Here


        d.add(d2);
        assertEquals(3, d.size());
    }

    public void testAddDigest2() {
        d2=new Digest(4);
        d2.add(new IpAddress(1111), 1,2,3);
        d2.add(new IpAddress(2222), 1,2,3);
        d2.add(new IpAddress(5555), 1,2,3);
        d2.add(new IpAddress(6666), 1,2,3);
        d.add(d2);
View Full Code Here

        entry=d.get(a3);
        assertEquals(entry, new Digest.Entry(20,25,33));
    }

    public void testIncrementHighSeqno() {
        d2=new Digest(3);
        d2.add(a1, 1, 100);
        d2.add(a2, 3, 300);
        d2.add(a3, 7, 700);

        long tmp=d2.highSeqnoAt(a1);
View Full Code Here

        assertEquals(0, d.size());
    }


    public void testConstructor2() {
        Digest dd=new Digest(3);
        assertEquals(0, dd.size());
    }
View Full Code Here

        testResetAt();
    }


    public void testNonConflictingMerge() {
        Digest cons_d=new Digest(5);
        IpAddress ip1=new IpAddress(1111), ip2=new IpAddress(2222);

        cons_d.add(ip1, 1, 10, 10);
        cons_d.add(ip2, 2, 20, 20);
        // System.out.println("\ncons_d before: " + cons_d);
        cons_d.merge(d);

        assertEquals(5, cons_d.size());
        //System.out.println("\ncons_d after: " + cons_d);
        assertEquals(1, cons_d.lowSeqnoAt(ip1));
        assertEquals(2, cons_d.lowSeqnoAt(ip2));
        assertEquals(4, cons_d.lowSeqnoAt(a1));
        assertEquals(25, cons_d.lowSeqnoAt(a2));
        assertEquals(20, cons_d.lowSeqnoAt(a3));

        assertEquals(10, cons_d.highSeqnoAt(ip1));
        assertEquals(20, cons_d.highSeqnoAt(ip2));
        assertEquals(500, cons_d.highSeqnoAt(a1));
        assertEquals(26, cons_d.highSeqnoAt(a2));
        assertEquals(25, cons_d.highSeqnoAt(a3));

        assertEquals(10, cons_d.highSeqnoSeenAt(ip1));
        assertEquals(20, cons_d.highSeqnoSeenAt(ip2));
        assertEquals(501, cons_d.highSeqnoSeenAt(a1));
        assertEquals(26, cons_d.highSeqnoSeenAt(a2));
        assertEquals(33, cons_d.highSeqnoSeenAt(a3));
    }
View Full Code Here

        assertEquals(33, cons_d.highSeqnoSeenAt(a3));
    }


    public void testConflictingMerge() {
        Digest new_d=new Digest(2);
        new_d.add(a1, 5, 450, 501);
        new_d.add(a3, 18, 28, 35);
        //System.out.println("\nd before: " + d);
        //System.out.println("new_: " + new_d);
        d.merge(new_d);

        assertEquals(3, d.size());
View Full Code Here

    public void testSameSendersOtherIsNull() {
        assertFalse(d.sameSenders(null));
    }

    public void testSameSenders1MNullDifferentLenth() {
        d2=new Digest(1);
        assertFalse(d2.sameSenders(d));
    }
View Full Code Here

        d2=new Digest(1);
        assertFalse(d2.sameSenders(d));
    }

    public void testSameSenders1MNullSameLength() {
        d2=new Digest(3);
        assertFalse(d2.sameSenders(d));
    }
View Full Code Here

        d2=d.copy();
        assertTrue(d.sameSenders(d2));
    }

    public void testSameSendersNotIdentical() {
        d2=new Digest(3);
        d2.add(a1, 4, 500, 501);
        d2.add(a3, 20, 25, 33);
        d2.add(a2, 25, 26, 26);
        assertTrue(d.sameSenders(d2));
    }
View Full Code Here

        d2.add(a2, 25, 26, 26);
        assertTrue(d.sameSenders(d2));
    }

    public void testSameSendersNotSameLength() {
        d2=new Digest(3);
        d2.add(a1, 4, 500, 501);
        d2.add(a2, 25, 26, 26);
        assertFalse(d.sameSenders(d2));
    }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.pbcast.Digest$Entry

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.