Home / Class/ IovArrayTest Class — netty Architecture

IovArrayTest Class — netty Architecture

Architecture documentation for the IovArrayTest class in IovArrayTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9606644a_44d8_6d55_82ff_96a63f06de6e["IovArrayTest"]
  154e7a02_e529_9e75_fab2_7c55e3797630["IovArrayTest.java"]
  9606644a_44d8_6d55_82ff_96a63f06de6e -->|defined in| 154e7a02_e529_9e75_fab2_7c55e3797630
  c89a7132_8bc9_ed2b_6e9b_d2ac5998c088["testNotFailsWihtoutMemoryAddress()"]
  9606644a_44d8_6d55_82ff_96a63f06de6e -->|method| c89a7132_8bc9_ed2b_6e9b_d2ac5998c088

Relationship Graph

Source Code

transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java lines 29–65

public abstract class IovArrayTest {

    @Test
    public void testNotFailsWihtoutMemoryAddress() {
        ByteBuf buffer = new NoMemoryAddressByteBuf(128);
        IovArray array = new IovArray(buffer);

        ByteBuf buf = Unpooled.directBuffer().writeZero(8);
        ByteBuf buf2 = new NoMemoryAddressByteBuf(8).writeZero(8);
        assertTrue(array.add(buf, 0, buf.readableBytes()));
        assertTrue(array.add(buf, 0, buf2.readableBytes()));
        assertEquals(2, array.count());
        assertEquals(16, array.size());
        assertTrue(buf.release());
        assertTrue(buf2.release());
        assertNotEquals(-1, array.memoryAddress(0));
        array.release();
        assertEquals(0, buffer.refCnt());
    }

    private static final class NoMemoryAddressByteBuf extends UnpooledDirectByteBuf {

        NoMemoryAddressByteBuf(int capacity) {
            super(UnpooledByteBufAllocator.DEFAULT, capacity, Integer.MAX_VALUE);
        }

        @Override
        public boolean hasMemoryAddress() {
            return false;
        }

        @Override
        public long memoryAddress() {
            throw new UnsupportedOperationException();
        }
    }
}

Frequently Asked Questions

What is the IovArrayTest class?
IovArrayTest is a class in the netty codebase, defined in transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java.
Where is IovArrayTest defined?
IovArrayTest is defined in transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/IovArrayTest.java at line 29.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free