Home / Class/ AbstractIntegrationTest Class — netty Architecture

AbstractIntegrationTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  60eb60f4_51df_0542_7955_f04cb7b76df6["AbstractIntegrationTest"]
  3fe16f61_c605_6938_ab4c_9085cd64f298["AbstractIntegrationTest.java"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|defined in| 3fe16f61_c605_6938_ab4c_9085cd64f298
  3c94dd64_49cb_5762_ba69_2f12b1cb8913["EmbeddedChannel()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 3c94dd64_49cb_5762_ba69_2f12b1cb8913
  b3e2d8de_3789_b1dc_85c5_43697d0bf4a5["initChannels()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| b3e2d8de_3789_b1dc_85c5_43697d0bf4a5
  1ccd8a30_8d28_6183_5eaf_d73c35f2473a["closeChannels()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 1ccd8a30_8d28_6183_5eaf_d73c35f2473a
  9b753771_cc5b_3156_00e2_42f7360bf468["testEmpty()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 9b753771_cc5b_3156_00e2_42f7360bf468
  2ae50d2f_f88c_46a3_681f_9392845111a8["testOneByte()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 2ae50d2f_f88c_46a3_681f_9392845111a8
  59624154_a492_7fc6_ba74_85d8e4225cec["testTwoBytes()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 59624154_a492_7fc6_ba74_85d8e4225cec
  3f4f3e43_1e9e_368c_4744_1877d4119378["testRegular()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 3f4f3e43_1e9e_368c_4744_1877d4119378
  20791ee9_4cf1_ad9b_f9fe_3d1d717e7445["testLargeRandom()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 20791ee9_4cf1_ad9b_f9fe_3d1d717e7445
  9476e958_a188_ef9e_921d_57eb5d4d0ba3["testPartRandom()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 9476e958_a188_ef9e_921d_57eb5d4d0ba3
  66beb20e_aa95_3f44_4b5e_c172220a5df0["testCompressible()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 66beb20e_aa95_3f44_4b5e_c172220a5df0
  d0f2fcf6_bd51_bac5_2247_7b1c36195690["testLongBlank()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| d0f2fcf6_bd51_bac5_2247_7b1c36195690
  9fcaa51a_a6ec_c219_c374_a09f978c6dff["testLongSame()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| 9fcaa51a_a6ec_c219_c374_a09f978c6dff
  f20eefc9_815e_7a3e_871e_a8a061c6baf2["testSequential()"]
  60eb60f4_51df_0542_7955_f04cb7b76df6 -->|method| f20eefc9_815e_7a3e_871e_a8a061c6baf2

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/AbstractIntegrationTest.java lines 42–267

public abstract class AbstractIntegrationTest {

    protected static final Random rand = new Random();

    protected EmbeddedChannel encoder;
    protected EmbeddedChannel decoder;

    protected abstract EmbeddedChannel createEncoder();
    protected abstract EmbeddedChannel createDecoder();

    public void initChannels() {
        encoder = createEncoder();
        decoder = createDecoder();
    }

    public void closeChannels() {
        encoder.close();
        for (;;) {
            Object msg = encoder.readOutbound();
            if (msg == null) {
                break;
            }
            ReferenceCountUtil.release(msg);
        }

        decoder.close();
        for (;;) {
            Object msg = decoder.readInbound();
            if (msg == null) {
                break;
            }
            ReferenceCountUtil.release(msg);
        }
    }

    @Test
    public void testEmpty() throws Exception {
        testIdentity(EmptyArrays.EMPTY_BYTES, true);
        testIdentity(EmptyArrays.EMPTY_BYTES, false);
    }

    @Test
    public void testOneByte() throws Exception {
        final byte[] data = { 'A' };
        testIdentity(data, true);
        testIdentity(data, false);
    }

    @Test
    public void testTwoBytes() throws Exception {
        final byte[] data = { 'B', 'A' };
        testIdentity(data, true);
        testIdentity(data, false);
    }

    @Test
    public void testRegular() throws Exception {
        final byte[] data = ("Netty is a NIO client server framework which enables " +
                "quick and easy development of network applications such as protocol " +
                "servers and clients.").getBytes(CharsetUtil.UTF_8);
        testIdentity(data, true);
        testIdentity(data, false);
    }

    @Test
    public void testLargeRandom() throws Exception {
        final byte[] data = new byte[1024 * 1024];
        rand.nextBytes(data);
        testIdentity(data, true);
        testIdentity(data, false);
    }

    @Test
    public void testPartRandom() throws Exception {
        final byte[] data = new byte[10240];
        rand.nextBytes(data);
        for (int i = 0; i < 1024; i++) {
            data[i] = 2;
        }
        testIdentity(data, true);
        testIdentity(data, false);

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free