Home / Function/ setUp() — netty Function Reference

setUp() — netty Function Reference

Architecture documentation for the setUp() function in DefaultHttp2FrameWriterTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  76b4a063_0511_6b28_64f4_fc4191b72dfa["setUp()"]
  602c48d7_d78b_d8f3_745e_26d2ab6ce0f2["DefaultHttp2FrameWriterTest"]
  76b4a063_0511_6b28_64f4_fc4191b72dfa -->|defined in| 602c48d7_d78b_d8f3_745e_26d2ab6ce0f2
  style 76b4a063_0511_6b28_64f4_fc4191b72dfa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameWriterTest.java lines 66–97

    @BeforeEach
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        http2HeadersEncoder = new DefaultHttp2HeadersEncoder(
                Http2HeadersEncoder.NEVER_SENSITIVE, new HpackEncoder(false, 16, 0));

        frameWriter = new DefaultHttp2FrameWriter(new DefaultHttp2HeadersEncoder(
                Http2HeadersEncoder.NEVER_SENSITIVE, new HpackEncoder(false, 16, 0)));

        outbound = Unpooled.buffer();

        expectedOutbound = Unpooled.EMPTY_BUFFER;

        promise = new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);

        Answer<Object> answer = new Answer<Object>() {
            @Override
            public Object answer(InvocationOnMock var1) throws Throwable {
                Object msg = var1.getArgument(0);
                if (msg instanceof ByteBuf) {
                    outbound.writeBytes((ByteBuf) msg);
                }
                ReferenceCountUtil.release(msg);
                return future;
            }
        };
        when(ctx.write(any())).then(answer);
        when(ctx.write(any(), any(ChannelPromise.class))).then(answer);
        when(ctx.alloc()).thenReturn(UnpooledByteBufAllocator.DEFAULT);
        when(ctx.channel()).thenReturn(channel);
        when(ctx.executor()).thenReturn(ImmediateEventExecutor.INSTANCE);
    }

Domain

Subdomains

Frequently Asked Questions

What does setUp() do?
setUp() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameWriterTest.java.
Where is setUp() defined?
setUp() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameWriterTest.java at line 66.

Analyze Your Own Codebase

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

Try Supermodel Free