Package org.jgroups.stack

Examples of org.jgroups.stack.NakReceiverWindow$Listener



    @Test(dataProvider="createTimer")
    public void testHighestDelivered(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);
            win.add(10, new Message());
            check(win, 0, 10, 0);
            System.out.println("win: " + win);
            win.add(9, new Message());
            win.add(7, new Message());
            win.add(8, new Message());
            win.add(6, new Message());
            win.add(5, new Message());
            System.out.println("win: " + win);
            check(win, 0, 10, 0);
            while((win.remove()) != null) ;
            check(win, 0, 10, 10);
            win.stable(5);
            System.out.println("win: " + win);
            check(win, 5, 10, 10);
            win.stable(10);
            System.out.println("win: " + win);
            check(win, 10, 10, 10);
        }
        finally {
            timer.stop();
View Full Code Here



    @Test(dataProvider="createTimer")
    public void testMissingMessages(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(5, new Message());
            check(win, 0, 5, 0);
            win.add(6, new Message());
            check(win, 0, 6, 0);
            System.out.println("win: " + win);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testMissingMessages2(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(5, new Message());
            check(win, 0, 5, 0);
            win.add(8, new Message());
            check(win, 0, 8, 0);
            win.add(9, new Message());
            check(win, 0, 9, 0);
            System.out.println("win: " + win);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testMissingMessages3(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);
            win.add(1, new Message());
            win.add(5, new Message());
            check(win, 0, 5, 0);
            win.add(8, new Message());
            check(win, 0, 8, 0);
            win.add(9, new Message());
            check(win, 0, 9, 0);
            System.out.println("win: " + win);
            win.add(2, new Message());
            check(win, 0, 9, 0);
            win.add(3, new Message());
            win.add(4, new Message());
            check(win, 0, 9, 0);
            win.add(7, new Message());
            check(win, 0, 9, 0);
            win.add(6, new Message());
            check(win, 0, 9, 0);
            win.add(10, new Message());
            check(win, 0, 10, 0);
            win.add(11, new Message());
            check(win, 0, 11, 0);
            System.out.println("win: " + win);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testMissingMessages4(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, timer);
            win.add(101, new Message());
            win.add(105, new Message());
            check(win, 0, 105, 100);
            win.add(108, new Message());
            check(win, 0, 108, 100);
            win.add(109, new Message());
            check(win, 0, 109, 100);
            System.out.println("win: " + win);
            win.add(102, new Message());
            check(win, 0, 109, 100);
            win.add(103, new Message());
            win.add(104, new Message());
            check(win, 0, 109, 100);
            win.add(107, new Message());
            check(win, 0, 109, 100);
            win.add(106, new Message());
            check(win, 0, 109, 100);
            win.add(110, new Message());
            check(win, 0, 110, 100);
            win.add(110, new Message());
            check(win, 0, 110, 100);
            System.out.println("win: " + win);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void testMissingMessages5(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 100, timer);
            win.add(101, new Message());
            check(win, 0, 101, 100);
            win.add(108, new Message());
            check(win, 0, 108, 100);
            win.remove();
            win.add(109, new Message());
            check(win, 0, 109, 101);
            System.out.println("win: " + win);
            win.add(102, new Message());
            check(win, 0, 109, 101);
            win.add(103, new Message());
            win.add(104, new Message());
            check(win, 0, 109, 101);
            win.add(107, new Message());
            check(win, 0, 109, 101);
            win.add(106, new Message());
            win.add(105, new Message());
            check(win, 0, 109, 101);
            win.add(110, new Message());
            check(win, 0, 110, 101);
            win.add(110, new Message());
            check(win, 0, 110, 101);
            System.out.println("win: " + win);
        }
        finally {
            timer.stop();
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test10(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());
            while((win.remove()) != null) ;
            check(win, 0, 4, 4);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test10a(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());
            while((win.remove()) != null) ;
            win.stable(4);
            check(win, 4, 4, 4);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test11(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());
            while((win.remove()) != null) ;
            win.destroy();
            check(win, 0, 0, 0);
        }
        finally {
            timer.stop();
        }
View Full Code Here


    @Test(dataProvider="createTimer")
    public void test12(TimeScheduler timer) throws Exception {
        try {
            NakReceiverWindow win=new NakReceiverWindow(sender, cmd, 0, timer);

            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)));

            Assert.assertEquals(1, ((Integer)win.remove().getObject()).intValue());
            Assert.assertEquals(2, ((Integer)win.remove().getObject()).intValue());
            Assert.assertEquals(3, ((Integer)win.remove().getObject()).intValue());
        }
        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.