Package org.jgroups.stack

Examples of org.jgroups.stack.NakReceiverWindow


        assertEquals(110, win.getHighestSeen());
        System.out.println("win: " + win);
    }

    public void test10() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        win.add(1, new Message());
        win.add(2, new Message());
        win.add(3, new Message());
        win.add(4, new Message());
        while((win.remove()) != null) ;
        assertTrue(win.getLowestSeen() == 1);
        assertTrue(win.getHighestSeen() == 4);
    }
View Full Code Here


        assertTrue(win.getLowestSeen() == 1);
        assertTrue(win.getHighestSeen() == 4);
    }

    public void test10a() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        win.add(1, new Message());
        win.add(2, new Message());
        win.add(3, new Message());
        win.add(4, new Message());
        while((win.remove()) != null) ;
        win.stable(4);
        assertTrue(win.getLowestSeen() == 4);
        assertTrue(win.getHighestSeen() == 4);

    }
View Full Code Here

        assertTrue(win.getHighestSeen() == 4);

    }

    public void test11() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        win.add(1, new Message());
        win.add(2, new Message());
        win.add(3, new Message());
        win.add(4, new Message());
        while((win.remove()) != null) ;
        win.reset();
        assertTrue(win.getLowestSeen() == 0);
        assertTrue(win.getHighestSeen() == 0);
    }
View Full Code Here

        assertTrue(win.getHighestSeen() == 0);
    }


    public void test12() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);

        win.add(1, new Message(null, null, new Integer(1)));
        win.add(2, new Message(null, null, new Integer(2)));
        win.add(3, new Message(null, null, new Integer(3)));

        assertTrue(((Integer)win.remove().getObject()).intValue() == 1);
        assertTrue(((Integer)win.remove().getObject()).intValue() == 2);
        assertTrue(((Integer)win.remove().getObject()).intValue() == 3);
    }
View Full Code Here

        super(name);
    }


    public void test1() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        assertTrue(win.getLowestSeen() == 0);
        assertTrue(win.getHighestSeen() == 0);
        assertNull(win.get(23));
    }
View Full Code Here

        assertTrue(win.getHighestSeen() == 0);
        assertNull(win.get(23));
    }

    public void test2() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 100);
        assertEquals(0, win.getLowestSeen());
        assertEquals(0, win.getHighestSeen());
    }
View Full Code Here

        assertEquals(0, win.getLowestSeen());
        assertEquals(0, win.getHighestSeen());
    }

    public void test3() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        win.add(1, new Message());
        assertNotNull(win.get(1));
        assertTrue(win.getLowestSeen() == 1);
        assertTrue(win.getHighestSeen() == 1);
        win.add(2, new Message());
        assertTrue(win.getLowestSeen() == 1);
        assertTrue(win.getHighestSeen() == 2);
        assertNotNull(win.get(2));
    }
View Full Code Here

        assertTrue(win.getHighestSeen() == 2);
        assertNotNull(win.get(2));
    }

    public void test4() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 1);
        win.add(2, new Message());
        assertTrue(win.getLowestSeen() == 0);
        assertTrue(win.getHighestSeen() == 0);
    }
View Full Code Here

        assertTrue(win.getLowestSeen() == 0);
        assertTrue(win.getHighestSeen() == 0);
    }

    public void test5() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 100);
        win.add(101, new Message());
        win.add(100, new Message());
        assertEquals(100, win.getLowestSeen());
        assertEquals(101, win.getHighestSeen());
    }
View Full Code Here

        assertEquals(100, win.getLowestSeen());
        assertEquals(101, win.getHighestSeen());
    }

    public void test6() throws Exception {
        NakReceiverWindow win=new NakReceiverWindow(null, 100);
        win.add(101, new Message());
        win.add(100, new Message());
        while((win.remove()) != null) ;
        assertNotNull(win.get(100));
        assertNotNull(win.get(101));
        assertTrue(win.getLowestSeen() == 100);
        assertTrue(win.getHighestSeen() == 101);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.NakReceiverWindow

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.