testEquals() — netty Function Reference
Architecture documentation for the testEquals() function in UnpooledTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 35051c12_71df_cb11_8ce7_4691871bd1b1["testEquals()"] 57588d83_f329_0d85_cfc5_eea9b8d43e8f["UnpooledTest"] 35051c12_71df_cb11_8ce7_4691871bd1b1 -->|defined in| 57588d83_f329_0d85_cfc5_eea9b8d43e8f style 35051c12_71df_cb11_8ce7_4691871bd1b1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
buffer/src/test/java/io/netty/buffer/UnpooledTest.java lines 91–157
@Test
public void testEquals() {
ByteBuf a, b;
// Different length.
a = wrappedBuffer(new byte[] { 1 });
b = wrappedBuffer(new byte[] { 1, 2 });
assertFalse(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Same content, same firstIndex, short length.
a = wrappedBuffer(new byte[] { 1, 2, 3 });
b = wrappedBuffer(new byte[] { 1, 2, 3 });
assertTrue(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Same content, different firstIndex, short length.
a = wrappedBuffer(new byte[] { 1, 2, 3 });
b = wrappedBuffer(new byte[] { 0, 1, 2, 3, 4 }, 1, 3);
assertTrue(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Different content, same firstIndex, short length.
a = wrappedBuffer(new byte[] { 1, 2, 3 });
b = wrappedBuffer(new byte[] { 1, 2, 4 });
assertFalse(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Different content, different firstIndex, short length.
a = wrappedBuffer(new byte[] { 1, 2, 3 });
b = wrappedBuffer(new byte[] { 0, 1, 2, 4, 5 }, 1, 3);
assertFalse(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Same content, same firstIndex, long length.
a = wrappedBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
b = wrappedBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
assertTrue(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Same content, different firstIndex, long length.
a = wrappedBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
b = wrappedBuffer(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 1, 10);
assertTrue(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Different content, same firstIndex, long length.
a = wrappedBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
b = wrappedBuffer(new byte[] { 1, 2, 3, 4, 6, 7, 8, 5, 9, 10 });
assertFalse(ByteBufUtil.equals(a, b));
a.release();
b.release();
// Different content, different firstIndex, long length.
a = wrappedBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
b = wrappedBuffer(new byte[] { 0, 1, 2, 3, 4, 6, 7, 8, 5, 9, 10, 11 }, 1, 10);
assertFalse(ByteBufUtil.equals(a, b));
a.release();
b.release();
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testEquals() do?
testEquals() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/UnpooledTest.java.
Where is testEquals() defined?
testEquals() is defined in buffer/src/test/java/io/netty/buffer/UnpooledTest.java at line 91.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free