Home / Class/ HttpChunkedInputTest Class — netty Architecture

HttpChunkedInputTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  b24236c6_8abc_d8c0_7070_21686bed749d["HttpChunkedInputTest"]
  ba7494e3_3e37_142b_8c27_de7334a04c06["HttpChunkedInputTest.java"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|defined in| ba7494e3_3e37_142b_8c27_de7334a04c06
  3408f276_c28b_590b_77e9_03d1b152f6bb["testChunkedStream()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 3408f276_c28b_590b_77e9_03d1b152f6bb
  138a4c95_1b23_296d_9942_13c9debafed8["testChunkedNioStream()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 138a4c95_1b23_296d_9942_13c9debafed8
  2ad66adf_3554_1550_8eb1_15c5866502be["testChunkedFile()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 2ad66adf_3554_1550_8eb1_15c5866502be
  44537d15_e63c_d10d_bb2f_6e4cc2c834cc["testChunkedNioFile()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 44537d15_e63c_d10d_bb2f_6e4cc2c834cc
  40558471_f936_ca56_0a63_4bd3b99a1969["testWrappedReturnNull()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 40558471_f936_ca56_0a63_4bd3b99a1969
  83072c38_8c0e_431b_9889_679ae897d324["check()"]
  b24236c6_8abc_d8c0_7070_21686bed749d -->|method| 83072c38_8c0e_431b_9889_679ae897d324

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpChunkedInputTest.java lines 42–158

public class HttpChunkedInputTest {
    private static final byte[] BYTES = new byte[1024 * 64];
    private static final File TMP;

    static {
        for (int i = 0; i < BYTES.length; i++) {
            BYTES[i] = (byte) i;
        }

        try {
            TMP = PlatformDependent.createTempFile("netty-chunk-", ".tmp", null);
            TMP.deleteOnExit();
            try (FileOutputStream out = new FileOutputStream(TMP)) {
                out.write(BYTES);
                out.flush();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Test
    public void testChunkedStream() {
        check(new HttpChunkedInput(new ChunkedStream(new ByteArrayInputStream(BYTES))));
    }

    @Test
    public void testChunkedNioStream() {
        check(new HttpChunkedInput(new ChunkedNioStream(Channels.newChannel(new ByteArrayInputStream(BYTES)))));
    }

    @Test
    public void testChunkedFile() throws IOException {
        check(new HttpChunkedInput(new ChunkedFile(TMP)));
    }

    @Test
    public void testChunkedNioFile() throws IOException {
        check(new HttpChunkedInput(new ChunkedNioFile(TMP)));
    }

    @Test
    public void testWrappedReturnNull() throws Exception {
        HttpChunkedInput input = new HttpChunkedInput(new ChunkedInput<ByteBuf>() {
            @Override
            public boolean isEndOfInput() throws Exception {
                return false;
            }

            @Override
            public void close() throws Exception {
                // NOOP
            }

            @Override
            public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception {
                return null;
            }

            @Override
            public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception {
                return null;
            }

            @Override
            public long length() {
                return 0;
            }

            @Override
            public long progress() {
                return 0;
            }
        });
        assertNull(input.readChunk(ByteBufAllocator.DEFAULT));
    }

    private static void check(ChunkedInput<?>... inputs) {
        EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler());

        for (ChunkedInput<?> input : inputs) {

Frequently Asked Questions

What is the HttpChunkedInputTest class?
HttpChunkedInputTest is a class in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpChunkedInputTest.java.
Where is HttpChunkedInputTest defined?
HttpChunkedInputTest is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpChunkedInputTest.java at line 42.

Analyze Your Own Codebase

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

Try Supermodel Free