Package com.sun.sgs.test.util

Examples of com.sun.sgs.test.util.UtilThreadGroup.run()


        r[0] = new ProducerRunnable(queue, 1);
        r[1] = new ProducerRunnable(queue, 10);
        r[2] = new ConsumerRunnable(queue, 4);
        r[3] = new ConsumerRunnable(queue, 7);
        UtilThreadGroup threadGroup = new UtilThreadGroup(r);
        threadGroup.run();
        assertEquals(0, threadGroup.getFailureCount());
    }

    @Test (timeout=5000)
        public void manyThreadsFewTasks() throws Exception {
View Full Code Here


        for (int i = 0; i < 64; i++)
            r[i] = new ProducerRunnable(queue, 4);
        for (int i = 64; i < 128; i++)
            r[i] = new ConsumerRunnable(queue, 4);
        UtilThreadGroup threadGroup = new UtilThreadGroup(r);
        threadGroup.run();
        assertEquals(0, threadGroup.getFailureCount());
    }

    @Test (timeout=5000)
        public void fewThreadsManyTasks() throws Exception {
View Full Code Here

        r[0] = new ProducerRunnable(queue, 674);
        r[1] = new ProducerRunnable(queue, 458);
        r[2] = new ConsumerRunnable(queue, 539);
        r[3] = new ConsumerRunnable(queue, 593);
        UtilThreadGroup threadGroup = new UtilThreadGroup(r);
        threadGroup.run();
        assertEquals(0, threadGroup.getFailureCount());
    }

    @Test (timeout=5000)
        public void manyThreadsManyTasks() throws Exception {
View Full Code Here

        for (int i = 0; i < 64; i++)
            r[i] = new ProducerRunnable(queue, 83);
        for (int i = 64; i < 128; i++)
            r[i] = new ConsumerRunnable(queue, 83);
        UtilThreadGroup threadGroup = new UtilThreadGroup(r);
        threadGroup.run();
        assertEquals(0, threadGroup.getFailureCount());
    }

    /**
     * Utility methods.
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.