From 0e249711cf2881a2b6ecd53f55694f57565916c4 Mon Sep 17 00:00:00 2001 From: RongtongJin Date: Tue, 16 Jan 2024 15:35:24 +0800 Subject: [PATCH] Remove useless UTs --- .../remoting/netty/FileRegionEncoderTest.java | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/remoting/src/test/java/org/apache/rocketmq/remoting/netty/FileRegionEncoderTest.java b/remoting/src/test/java/org/apache/rocketmq/remoting/netty/FileRegionEncoderTest.java index e756abce484..535ce432f38 100644 --- a/remoting/src/test/java/org/apache/rocketmq/remoting/netty/FileRegionEncoderTest.java +++ b/remoting/src/test/java/org/apache/rocketmq/remoting/netty/FileRegionEncoderTest.java @@ -82,51 +82,4 @@ private static void write(File file, byte[] data) throws IOException { } } } - - @Test - public void testUnpooledByteBuffer() { - ByteBuffer buffer = ByteBuffer.allocateDirect(128); - try { - int value = Integer.MAX_VALUE; - for (int i = 0; i < 128 / 4; i++) { - buffer.putInt(value); - } - buffer.flip(); - ByteBuf buf1 = Unpooled.wrappedBuffer(buffer); - Assert.assertEquals(buf1.readableBytes(), 128); - Assert.assertEquals(buf1.readerIndex(), 0); - Assert.assertEquals(buf1.writerIndex(), 128); - - for (int i = 0; i < 128 / 4; i++) { - Assert.assertEquals(buf1.readInt(), value); - } - } finally { - ((DirectBuffer) buffer).cleaner().clean(); - } - } - - @Test - public void testCompositeByteBuffer() { - ByteBuffer buffer = ByteBuffer.allocateDirect(128); - try { - int value = Integer.MAX_VALUE; - for (int i = 0; i < 128 / 4; i++) { - buffer.putInt(value); - } - buffer.flip(); - ByteBuf buf = Unpooled.wrappedBuffer(buffer); - CompositeByteBuf cbuf = ByteBufAllocator.DEFAULT.compositeBuffer(); - cbuf.addComponent(true, buf); - Assert.assertEquals(cbuf.readerIndex(), 0); - Assert.assertEquals(cbuf.writerIndex(), 128); - Assert.assertEquals(cbuf.readableBytes(), 128); - Assert.assertEquals(cbuf.refCnt(), 1); - Assert.assertEquals(buf.refCnt(), 1); - cbuf.release(); - Assert.assertEquals(cbuf.refCnt(), 0); - Assert.assertEquals(buf.refCnt(), 0); - } finally { - ((DirectBuffer) buffer).cleaner().clean(); - } - } } \ No newline at end of file