readResponseTest() — netty Function Reference
Architecture documentation for the readResponseTest() function in DnsResponseTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ad5617b4_a3c4_a834_f67a_9e77f9719578["readResponseTest()"] 25f291e1_1e80_03cf_b3ec_348dc0858536["DnsResponseTest"] ad5617b4_a3c4_a834_f67a_9e77f9719578 -->|defined in| 25f291e1_1e80_03cf_b3ec_348dc0858536 style ad5617b4_a3c4_a834_f67a_9e77f9719578 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-dns/src/test/java/io/netty/handler/codec/dns/DnsResponseTest.java lines 75–96
@Test
public void readResponseTest() {
EmbeddedChannel embedder = new EmbeddedChannel(new DatagramDnsResponseDecoder());
for (byte[] p: packets) {
ByteBuf packet = embedder.alloc().buffer(512).writeBytes(p);
embedder.writeInbound(new DatagramPacket(packet, null, new InetSocketAddress(0)));
AddressedEnvelope<DnsResponse, InetSocketAddress> envelope = embedder.readInbound();
assertInstanceOf(DatagramDnsResponse.class, envelope);
DnsResponse response = envelope.content();
assertSame(envelope, response);
ByteBuf raw = Unpooled.wrappedBuffer(p);
assertEquals(raw.getUnsignedShort(0), response.id());
assertEquals(raw.getUnsignedShort(4), response.count(DnsSection.QUESTION));
assertEquals(raw.getUnsignedShort(6), response.count(DnsSection.ANSWER));
assertEquals(raw.getUnsignedShort(8), response.count(DnsSection.AUTHORITY));
assertEquals(raw.getUnsignedShort(10), response.count(DnsSection.ADDITIONAL));
envelope.release();
}
assertFalse(embedder.finish());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does readResponseTest() do?
readResponseTest() is a function in the netty codebase, defined in codec-dns/src/test/java/io/netty/handler/codec/dns/DnsResponseTest.java.
Where is readResponseTest() defined?
readResponseTest() is defined in codec-dns/src/test/java/io/netty/handler/codec/dns/DnsResponseTest.java at line 75.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free