Package reactor.net

Examples of reactor.net.Reconnect.reconnect()


    @Test
    public void testDefaultReconnect() {
        Reconnect rec = new IncrementalBackoffReconnectSpec().get();

        InetSocketAddress a1 = new InetSocketAddress("129.168.0.1",1001);
        Tuple2<InetSocketAddress, Long> t1 = rec.reconnect(a1, 0);

        assertEquals(IncrementalBackoffReconnectSpec.DEFAULT_INTERVAL,t1.getT2().longValue());
        assertEquals(a1,t1.getT1());

        InetSocketAddress a2 = new InetSocketAddress("129.168.0.1",1001);
View Full Code Here


        assertEquals(IncrementalBackoffReconnectSpec.DEFAULT_INTERVAL,t1.getT2().longValue());
        assertEquals(a1,t1.getT1());

        InetSocketAddress a2 = new InetSocketAddress("129.168.0.1",1001);
        Tuple2<InetSocketAddress, Long> t2 = rec.reconnect(a1, 0);

        assertEquals(IncrementalBackoffReconnectSpec.DEFAULT_INTERVAL,t2.getT2().longValue());
        assertEquals(a2,t2.getT1());
    }
View Full Code Here

            .interval(5000)
            .maxInterval(10000)
            .multiplier(2)
            .get();

        assertEquals(    0L,(long)rec.reconnect(addr1,0).getT2());
        assertEquals( 5000L,(long)rec.reconnect(addr1,1).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,2).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,3).getT2());
    }
View Full Code Here

            .maxInterval(10000)
            .multiplier(2)
            .get();

        assertEquals(    0L,(long)rec.reconnect(addr1,0).getT2());
        assertEquals( 5000L,(long)rec.reconnect(addr1,1).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,2).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,3).getT2());
    }

    @Test
View Full Code Here

            .multiplier(2)
            .get();

        assertEquals(    0L,(long)rec.reconnect(addr1,0).getT2());
        assertEquals( 5000L,(long)rec.reconnect(addr1,1).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,2).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,3).getT2());
    }

    @Test
    public void testRoundRobinAddresses() {
View Full Code Here

            .get();

        assertEquals(    0L,(long)rec.reconnect(addr1,0).getT2());
        assertEquals( 5000L,(long)rec.reconnect(addr1,1).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,2).getT2());
        assertEquals(10000L,(long)rec.reconnect(addr1,3).getT2());
    }

    @Test
    public void testRoundRobinAddresses() {
        InetSocketAddress addr1 = new InetSocketAddress("129.168.0.1",1001);
View Full Code Here

            .address(addr1)
            .address(addr2)
            .address(addr3)
            .get();

        assertEquals(addr1,rec.reconnect(addr1,0).getT1());
        assertEquals(addr2,rec.reconnect(addr2,1).getT1());
        assertEquals(addr3,rec.reconnect(addr3,2).getT1());
    }
}
View Full Code Here

            .address(addr2)
            .address(addr3)
            .get();

        assertEquals(addr1,rec.reconnect(addr1,0).getT1());
        assertEquals(addr2,rec.reconnect(addr2,1).getT1());
        assertEquals(addr3,rec.reconnect(addr3,2).getT1());
    }
}
View Full Code Here

            .address(addr3)
            .get();

        assertEquals(addr1,rec.reconnect(addr1,0).getT1());
        assertEquals(addr2,rec.reconnect(addr2,1).getT1());
        assertEquals(addr3,rec.reconnect(addr3,2).getT1());
    }
}
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.