Package org.jgroups.util

Examples of org.jgroups.util.Queue.closed()


        int size=queue.size();
        queue.removeElement("Q5");
        assert queue.size() == size -1;
        assert queue.peek().equals("Q3");
        assert queue.remove().equals("Q3");
        assert queue.closed();
    }


    @Test(expectedExceptions=QueueClosedException.class)
    public static void testCloseWithoutFlush() throws QueueClosedException {
View Full Code Here


        final Queue queue=new Queue();
        for(int i=0; i < 10; i++)
            queue.add(new Integer(i));
        new Thread() {
            public void run() {
                while(!queue.closed()) {
                    try {
                        System.out.println("-- removed " + queue.remove());
                        Util.sleep(200);
                    }
                    catch(QueueClosedException e) {
View Full Code Here

        final Queue queue=new Queue();
        for(int i=0; i < 10; i++)
            queue.add(new Integer(i));
        new Thread() {
            public void run() {
                while(!queue.closed()) {
                    try {
                        System.out.println("-- removed " + queue.remove());
                        Util.sleep(200);
                    }
                    catch(QueueClosedException e) {
View Full Code Here

        final Queue queue=new Queue();
        String s1="Q1";

        try {
            queue.removeElement(s1);
            assert !(queue.closed());
            assert queue.size() == 0;
        }
        catch(QueueClosedException ex) {
            assert false : ex.toString();
        }
View Full Code Here

        final Queue queue=new Queue();
        for(int i=0; i < 10; i++)
            queue.add(new Integer(i));
        new Thread() {
            public void run() {
                while(!queue.closed()) {
                    try {
                        System.out.println("-- removed " + queue.remove());
                        Util.sleep(200);
                    }
                    catch(QueueClosedException e) {
View Full Code Here

        final Queue queue=new Queue();
        String s1="Q1";

        try {
            queue.removeElement(s1);
            assert !(queue.closed());
            assert queue.size() == 0;
        }
        catch(QueueClosedException ex) {
            assert false : ex.toString();
        }
View Full Code Here

        int size=queue.size();
        queue.removeElement("Q5");
        assert queue.size() == size -1;
        assert queue.peek().equals("Q3");
        assert queue.remove().equals("Q3");
        assert queue.closed();
    }


    @Test(expectedExceptions=QueueClosedException.class)
    public static void testCloseWithoutFlush() throws QueueClosedException {
View Full Code Here

        final Queue queue=new Queue();
        for(int i=0; i < 10; i++)
            queue.add(new Integer(i));
        new Thread() {
            public void run() {
                while(!queue.closed()) {
                    try {
                        System.out.println("-- removed " + queue.remove());
                        Util.sleep(200);
                    }
                    catch(QueueClosedException e) {
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.