Package org.jgroups.util

Examples of org.jgroups.util.SeqnoList$Seqno


        _testIteration(new SeqnoList(15).add(5,10), Arrays.asList(5L,6L,7L,8L,9L,10L));
    }


    public static void testIteration3() {
        _testIteration(new SeqnoList(12).add(5,10).add(11), Arrays.asList(5L,6L,7L,8L,9L,10L,11L));
    }
View Full Code Here


    public static void testIteration3() {
        _testIteration(new SeqnoList(12).add(5,10).add(11), Arrays.asList(5L,6L,7L,8L,9L,10L,11L));
    }

    public static void testIteration4() {
        _testIteration(new SeqnoList(11).add(4).add(5, 10), Arrays.asList(4L, 5L,6L,7L,8L,9L,10L));
    }
View Full Code Here

    public static void testIteration4() {
        _testIteration(new SeqnoList(11).add(4).add(5, 10), Arrays.asList(4L, 5L,6L,7L,8L,9L,10L));
    }

    public static void testIteration5() {
        _testIteration(new SeqnoList(15).add(3).add(5, 10).add(12), Arrays.asList(3L, 5L,6L,7L,8L,9L,10L,12L));
    }
View Full Code Here

    public static void testIteration5() {
        _testIteration(new SeqnoList(15).add(3).add(5, 10).add(12), Arrays.asList(3L, 5L,6L,7L,8L,9L,10L,12L));
    }

    public static void testIteration6() {
        _testIteration(new SeqnoList(8).add(3).add(5, 5).add(7), Arrays.asList(3L,5L,7L));
    }
View Full Code Here

        _testIteration(new SeqnoList(8).add(3).add(5, 5).add(7), Arrays.asList(3L,5L,7L));
    }


    public void testSerialization() throws Exception {
        SeqnoList list=new SeqnoList(1000).add(1, 10, 50)
          .add(100,150).add(152,153).add(200,205).add(300,304,306).add(400,450).add(500);
        for(int i=502; i < 550; i+=2)
            list.add(i);
        System.out.println("list.size()=" + list.size()  + "\nlist = " + list);
        int expected_size=list.serializedSize();
        byte[] buf=Util.streamableToByteBuffer(list);
        SeqnoList list2=(SeqnoList)Util.streamableFromByteBuffer(SeqnoList.class,buf);
        System.out.println("list2.size()=" + list2.size() + "\nlist2 = " + list2);
        assert list.size() == list2.size();

        System.out.println("expected size=" + expected_size + ", buf size=" + buf.length);
        assert buf.length == expected_size;

        Iterator<Long> it1=list.iterator(), it2=list2.iterator();
        while(it1.hasNext()) {
            long seq1=it1.next(), seq2=it2.next();
            assert seq1 == seq2;
        }
    }
View Full Code Here

TOP

Related Classes of org.jgroups.util.SeqnoList$Seqno

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.