@Test public void testTwoBackOffsAndDoneSendingInTheMiddle() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 500}); verifyBackOffWithDoneSending(manager, 2, 200, 1, true, true); }
@Test public void testExhaustedBackOffsWithTwo() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOff(manager, 3, 200, true, true, false); }
@Test public void testExhaustedBackOffsWithOneAndRestarted() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100}); verifyBackOff(manager, 3, 200, true, false, true); }
@Test public void testTwoBackOffsAndDoneSendingAfterLast() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOffWithDoneSending(manager, 2, 200, 0, true, true); }
@Test public void testOneBackOff() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100}); verifyBackOff(manager, 1, 100, true); }
@Test public void testTwoBackOffs() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOff(manager, 2, 200, true, true); }
@Test public void testOneThreadStoppedBeforeBackOff() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {500}); verifyMultipleThreadsStoppedBeforeBackOff(manager, 1, 200); }
@Test public void testExhaustedBackOffsWithOne() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100}); verifyBackOff(manager, 2, 100, true, false); }
@Test public void testTwoThreadsStoppedBeforeBackOff() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {500}); verifyMultipleThreadsStoppedBeforeBackOff(manager, 2, 200); }
@Test public void testStopWhileWaiting() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {500, 200}); verifyMultipleThreadsStoppedWhileBackOff(manager, 1, 0); }
@Test public void testExhaustedBackOffsWithTwoAndRestarted() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOff(manager, 4, 300, true, true, false, true); }
@Test public void testSevenThreadsStoppedBeforeBackOff() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[]{500}); verifyMultipleThreadsStoppedBeforeBackOff(manager, 7, 200); }
@Test public void testTwoBackOffsAndDoneSendingBefore() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOffWithDoneSending(manager, 2, 200, 0, true, true); }
@Test public void testTwoBackOffsAndDoneSendingAfterFirstOfNewRound() throws InterruptedException { SenderThreadsBackOffManager manager = createManager(new long[] {100, 100}); verifyBackOffWithDoneSending(manager, 5, 400, 3, true, true, false, true, true); }