Package org.jgroups.stack

Examples of org.jgroups.stack.NakReceiverWindow$Listener



    @Test(dataProvider="createTimer")
    public void test3(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            assert win.get(1) != null;
            check(win, 0, 1, 0);
            win.add(2, new Message());
            check(win, 0, 2, 0);
            assert win.get(2) != null;
            win.remove();
            check(win, 0, 2, 1);
            win.remove();
            check(win, 0, 2, 2);
        }
        finally {
            timer.stop();
        }
View Full Code Here



    @Test(dataProvider="createTimer")
    public void test4(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 1, timer);
            win.add(2, new Message());
            check(win, 0, 2, 1);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test5(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, timer);
            win.add(101, new Message());
            win.add(100, new Message());
            check(win, 0, 101, 100);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test6(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, timer);
            win.add(101, new Message());
            System.out.println("win: " + win);
            win.add(100, new Message());
            System.out.println("win: " + win);
            check(win, 0, 101, 100);
            win.remove();
            System.out.println("win: " + win);
            check(win, 0, 101, 101);
            while((win.remove()) != null);
            check(win, 0, 101, 101);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testLowerBounds(TimeScheduler timer) {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, 50, timer);
            win.add(101, new Message());
            System.out.println("win: " + win);
            win.add(100, new Message());
            System.out.println("win: " + win);
            check(win, 50, 101, 100);
            win.remove();
            System.out.println("win: " + win);
            check(win, 50, 101, 101);
            while((win.remove()) != null);
            check(win, 50, 101, 101);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test7(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(2, new Message());
            win.add(3, new Message());
            win.add(4, new Message());
            check(win, 0, 4, 0);
            System.out.println("Note that the subsequent warning is expected:");
            win.stable(4); // no-op because we haven't even removed 4 messages
            check(win, 0, 4, 0);
            while(win.remove() != null);
            check(win, 0, 4, 4);
            win.stable(4);
            check(win, 4, 4, 4);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testLowerBounds2(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, 50, timer);
            win.add(100, new Message());
            win.add(101, new Message());
            win.add(102, new Message());
            win.add(103, new Message());
            System.out.println("win: " + win);
            check(win, 50, 103, 100);
            System.out.println("Note that the subsequent warning is expected:");
            win.stable(103); // no-op because we haven't even removed 4 messages
            check(win, 50, 103, 100);
            while(win.remove() != null);
            check(win, 50, 103, 103);
            win.stable(103);
            System.out.println("win: " + win);
            check(win, 103, 103, 103);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test8(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(2, new Message());
            win.add(3, new Message());
            win.add(4, new Message());
            win.add(6, new Message());
            check(win, 0, 6, 0); // haven't delivered a message yet
            while(win.remove() != null);
            check(win, 0, 6, 4);
            win.add(5, new Message());
            check(win, 0, 6, 4);
            win.remove();
            check(win, 0, 6, 5);
            win.remove();
            check(win, 0, 6, 6);
            win.stable(4);
            check(win, 4, 6, 6);
            win.stable(6);
            check(win, 6, 6, 6);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testAdd(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            check(win, 0, 0, 0);
            win.add(0, new Message()); // discarded, next expected is 1
            check(win, 0, 0, 0);
            win.add(1, new Message());
            check(win, 0, 1, 0);
            win.add(2, new Message());
            win.add(3, new Message());
            win.add(4, new Message());
            check(win, 0, 4, 0);
            win.add(6, new Message());
            check(win, 0, 6, 0);
            win.add(5, new Message());
            check(win, 0, 6, 0);
            while(win.remove() != null) ;
            check(win, 0, 6, 6);
            win.stable(4);
            check(win, 4, 6, 6);
            win.stable(6);
            check(win, 6, 6, 6);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test9(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(2, new Message());
            win.add(3, new Message());
            win.add(4, new Message());
            win.add(6, new Message());
            System.out.println("win: " + win);
            while((win.remove()) != null) ;
            win.stable(6); // 6 is ignore as it is >= highest delivered message
            System.out.println("win: " + win);
            assert win.get(2) != null;
            check(win, 0, 6, 4);
            win.add(5, new Message());
            check(win, 0, 6, 4);
            while((win.remove()) != null) ;
            check(win, 0, 6, 6);
            win.stable(6);
            check(win, 6, 6, 6);
        }
        finally {
            timer.stop();
        }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.NakReceiverWindow$Listener

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.