private static void assertQueueEmpty(PendingWriteQueue queue) { Assert.assertTrue(queue.isEmpty()); Assert.assertEquals(0, queue.size()); Assert.assertNull(queue.current()); Assert.assertNull(queue.removeAndWrite()); Assert.assertNull(queue.removeAndWriteAll()); }
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { queue.add(msg, promise); Assert.assertFalse(queue.isEmpty()); Assert.assertEquals(++expectedSize, queue.size()); Assert.assertNotNull(queue.current()); }