Package org.jgroups.stack

Examples of org.jgroups.stack.ExponentialInterval


    public void tearDown() throws Exception {
        super.tearDown();
    }

    public void testInitialization() {
        interval=new ExponentialInterval(10);
        System.out.println("interval=" + interval);
        long value=interval.next();
        System.out.println("interval=" + interval);
        assertEquals(10, value);
        value=interval.next();
View Full Code Here


        System.out.println("interval=" + interval);
        assertEquals(20, value);
    }

    public void testNoargConstructor() {
        interval=new ExponentialInterval();
        assertEquals(30, interval.next());
        assertEquals(60, interval.next());
    }
View Full Code Here

        assertEquals(60, interval.next());
    }


    public void testMax() {
        interval=new ExponentialInterval(1000);
        System.out.println("interval=" + interval);
        assertEquals(1000, interval.next());
        System.out.println("interval=" + interval);
        assertEquals(2000, interval.next());
        System.out.println("interval=" + interval);
View Full Code Here

    @DataProvider(name="createRetransmitter")
    protected Retransmitter[][] createRetransmitter() {
        Retransmitter range_based_retransmitter=new RangeBasedRetransmitter(sender, new MyXmitter(), timer);
        Retransmitter old_retransmitter=new DefaultRetransmitter(sender, new MyXmitter(), timer);

        range_based_retransmitter.setRetransmitTimeouts(new ExponentialInterval(1000));
        range_based_retransmitter.reset();
        old_retransmitter.setRetransmitTimeouts(new ExponentialInterval(1000));
        old_retransmitter.reset();

        return new Retransmitter[][] {
          {old_retransmitter},
          {range_based_retransmitter}
View Full Code Here

*/
public class ExponentialIntervalTest {

    @Test(groups=Global.FUNCTIONAL)
    public static void testInitialization() {
        ExponentialInterval interval=new ExponentialInterval(10);
        System.out.println("interval=" + interval);
        long value=interval.next();
        System.out.println("interval=" + interval);
        Assert.assertEquals(10, value);
        value=interval.next();
        System.out.println("interval=" + interval);
        Assert.assertEquals(20, value);
    }
View Full Code Here

        Assert.assertEquals(20, value);
    }

    @Test(groups=Global.FUNCTIONAL)
    public static void testNoargConstructor() {
        ExponentialInterval interval=new ExponentialInterval();
        Assert.assertEquals(30, interval.next());
        Assert.assertEquals(60, interval.next());
    }
View Full Code Here

    }


    @Test(groups=Global.FUNCTIONAL)
    public static void testMax() {
        ExponentialInterval interval=new ExponentialInterval(1000);
        System.out.println("interval=" + interval);
        Assert.assertEquals(1000, interval.next());
        System.out.println("interval=" + interval);
        Assert.assertEquals(2000, interval.next());
        System.out.println("interval=" + interval);
        Assert.assertEquals(4000, interval.next());
        System.out.println("interval=" + interval);
        Assert.assertEquals(8000, interval.next());
        System.out.println("interval=" + interval);
        Assert.assertEquals(15000, interval.next());
        System.out.println("interval=" + interval);
        Assert.assertEquals(15000, interval.next());
        System.out.println("interval=" + interval);

    }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.ExponentialInterval

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.