Examples of AckCollector


Examples of org.jgroups.util.AckCollector

        assert ac.size() == 5;
    }

    public void testDestroy() {
        List<Address> tmp_list=Arrays.asList(one,two,one,three,four,one,five);
        final AckCollector ac=new AckCollector(tmp_list);
        System.out.println("ac = " + ac);
        assert ac.size() == 5;
        Thread thread=new Thread() {
            public void run() {
                Util.sleep(2000);
                ac.destroy();
            }
        };
        thread.start();
        boolean result=ac.waitForAllAcks(10000);
        System.out.println("result = " + result);
        assert !result;
    }
View Full Code Here

Examples of org.jgroups.util.AckCollector

        System.out.println("result = " + result);
        assert !result;
    }

    public static void testNullList() throws TimeoutException {
        AckCollector coll=new AckCollector();
        coll.waitForAllAcks(1000);
    }
View Full Code Here

Examples of org.jgroups.util.AckCollector

        coll.waitForAllAcks(1000);
    }

    public static void testOneList() throws TimeoutException {
        Address addr=Util.createRandomAddress();
        AckCollector coll=new AckCollector(addr);
        coll.ack(addr);
        coll.waitForAllAcks(1000);
    }
View Full Code Here

Examples of org.jgroups.util.AckCollector

        coll.ack(addr);
        coll.waitForAllAcks(1000);
    }

    public void testSuspect() {
        final AckCollector ac=new AckCollector(list);
        for(Address member: Arrays.asList(one,four,five))
            ac.ack(member);
        System.out.println("ac = " + ac);
        for(Address suspected: Arrays.asList(two,three))
            ac.suspect(suspected);
        System.out.println("ac = " + ac);
        assert ac.size() == 0;
        assert ac.waitForAllAcks();
    }
View Full Code Here

Examples of org.jgroups.util.AckCollector

        assert ac.size() == 0;
        assert ac.waitForAllAcks();
    }

    public void testRetainAll() {
        final AckCollector ac=new AckCollector(list);
        List<Address> members=Arrays.asList(one, two, three);
        ac.retainAll(members);
        System.out.println("ac=" + ac);
        assert ac.size() == 3;

        new Thread() {
            public void run() {
                Util.sleep(1000);
                ac.suspect(two);
                Util.sleep(500);
                ac.ack(three); ac.ack(one);
            }
        }.start();

        boolean received_all=ac.waitForAllAcks(30000);
        System.out.println("ac = " + ac);
        assert received_all;
    }
View Full Code Here

Examples of org.jgroups.util.AckCollector

        System.out.println("ac = " + ac);
        assert received_all;
    }

    public void testRetainAll2() {
        final AckCollector ac=new AckCollector(list);
        assert ac.size() == 5;
        System.out.println("ac = " + ac);
        ac.ack(five);
        ac.suspect(four);
        System.out.println("ac = " + ac);

        new Thread() {
            public void run() {
                Util.sleep(1000);
                ac.retainAll(Arrays.asList(five));
                System.out.println("ac=" + ac);
            }
        }.start();

        boolean received_all=ac.waitForAllAcks(30000);
        System.out.println("ac = " + ac);
        assert received_all;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.