Home / Class/ FullMemcacheMessageResponseTest Class — netty Architecture

FullMemcacheMessageResponseTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  22495206_3c93_60d7_837f_6202740f0f78["FullMemcacheMessageResponseTest"]
  115359ff_4a5e_745e_4795_877d0c9446d2["FullMemcacheMessageResponseTest.java"]
  22495206_3c93_60d7_837f_6202740f0f78 -->|defined in| 115359ff_4a5e_745e_4795_877d0c9446d2
  5a4b46de_1e09_8929_d967_e295140fe97a["setup()"]
  22495206_3c93_60d7_837f_6202740f0f78 -->|method| 5a4b46de_1e09_8929_d967_e295140fe97a
  6def7968_4ffb_74cd_0925_ebdb3e6c9e80["teardown()"]
  22495206_3c93_60d7_837f_6202740f0f78 -->|method| 6def7968_4ffb_74cd_0925_ebdb3e6c9e80
  a7fd0259_7124_190b_d818_c9b3b4f2db18["testEncodeDecode()"]
  22495206_3c93_60d7_837f_6202740f0f78 -->|method| a7fd0259_7124_190b_d818_c9b3b4f2db18

Relationship Graph

Source Code

codec-memcache/src/test/java/io/netty/handler/codec/memcache/binary/FullMemcacheMessageResponseTest.java lines 30–64

public class FullMemcacheMessageResponseTest {

    private EmbeddedChannel channel;

    @BeforeEach
    public void setup() throws Exception {
        channel = new EmbeddedChannel(
                new BinaryMemcacheResponseEncoder(),
                new BinaryMemcacheResponseDecoder(),
                new BinaryMemcacheObjectAggregator(1024));
    }

    @AfterEach
    public void teardown() throws Exception {
        assertFalse(channel.finish());
    }

    @Test
    public void testEncodeDecode() throws Exception {
        ByteBuf key = Unpooled.wrappedBuffer("key".getBytes(CharsetUtil.UTF_8));
        ByteBuf content = Unpooled.wrappedBuffer("content".getBytes(CharsetUtil.UTF_8));
        ByteBuf extras = Unpooled.wrappedBuffer("extras".getBytes(CharsetUtil.UTF_8));
        FullBinaryMemcacheResponse resp = new DefaultFullBinaryMemcacheResponse(key, extras, content);
        assertTrue(channel.writeOutbound(resp));
        // header + content
        assertEquals(2, channel.outboundMessages().size());
        assertTrue(channel.writeInbound(channel.readOutbound(), channel.readOutbound()));

        FullBinaryMemcacheResponse read = channel.readInbound();
        assertEquals("key", read.key().toString(CharsetUtil.UTF_8));
        assertEquals("content", read.content().toString(CharsetUtil.UTF_8));
        assertEquals("extras", read.extras().toString(CharsetUtil.UTF_8));
        read.release();
    }
}

Frequently Asked Questions

What is the FullMemcacheMessageResponseTest class?
FullMemcacheMessageResponseTest is a class in the netty codebase, defined in codec-memcache/src/test/java/io/netty/handler/codec/memcache/binary/FullMemcacheMessageResponseTest.java.
Where is FullMemcacheMessageResponseTest defined?
FullMemcacheMessageResponseTest is defined in codec-memcache/src/test/java/io/netty/handler/codec/memcache/binary/FullMemcacheMessageResponseTest.java at line 30.

Analyze Your Own Codebase

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

Try Supermodel Free