@Test(dataProvider = "createTimer") public void testRemoveOOBMessage(TimeScheduler timer) { try { NakReceiverWindow win = new NakReceiverWindow(sender, cmd, 0, timer); System.out.println("win = " + win); win.add(2, msg()); System.out.println("win = " + win); assert win.removeOOBMessage() == null; assert win.remove() == null; win.add(1, oob()); System.out.println("win = " + win); assert win.removeOOBMessage() != null; System.out.println("win = " + win); assert win.removeOOBMessage() == null; assert win.remove() != null; assert win.remove() == null; assert win.removeOOBMessage() == null; } finally { timer.stop(); } }
@Test(dataProvider = "createTimer") public void testRemoveRegularAndOOBMessages(TimeScheduler timer) { try { NakReceiverWindow win = new NakReceiverWindow(sender, cmd, 0, timer); win.add(1, msg()); System.out.println("win = " + win); win.remove(); System.out.println("win = " + win); assert win.getHighestDelivered() == 1; win.add(3, msg()); win.remove(); System.out.println("win = " + win); assert win.getHighestDelivered() == 1; win.add(2, oob()); win.removeOOBMessage(); System.out.println("win = " + win); assert win.getHighestDelivered() == 2; } finally { timer.stop(); } }