testResponseEncode() — netty Function Reference
Architecture documentation for the testResponseEncode() function in TcpDnsTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 5ddc7cd9_da7e_2e08_15a7_159efd6777bf["testResponseEncode()"] 577c6a24_a466_dd64_fc56_8363340dbefc["TcpDnsTest"] 5ddc7cd9_da7e_2e08_15a7_159efd6777bf -->|defined in| 577c6a24_a466_dd64_fc56_8363340dbefc style 5ddc7cd9_da7e_2e08_15a7_159efd6777bf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-dns/src/test/java/io/netty/handler/codec/dns/TcpDnsTest.java lines 73–94
@Test
public void testResponseEncode() {
EmbeddedChannel channel = new EmbeddedChannel(new TcpDnsResponseEncoder());
int randomID = new Random().nextInt(60000 - 1000) + 1000;
DnsQuery query = new DefaultDnsQuery(randomID, DnsOpCode.QUERY)
.setRecord(DnsSection.QUESTION, new DefaultDnsQuestion(QUERY_DOMAIN, DnsRecordType.A));
DnsQuestion question = query.recordAt(DnsSection.QUESTION);
channel.writeInbound(newResponse(query, question, QUERY_RESULT));
DnsResponse readResponse = channel.readInbound();
assertEquals(question, readResponse.recordAt(DnsSection.QUESTION));
DnsRawRecord record = new DefaultDnsRawRecord(question.name(),
DnsRecordType.A, TTL, Unpooled.wrappedBuffer(QUERY_RESULT));
assertEquals(record, readResponse.recordAt(DnsSection.ANSWER));
assertEquals(record.content(), readResponse.<DnsRawRecord>recordAt(DnsSection.ANSWER).content());
ReferenceCountUtil.release(readResponse);
ReferenceCountUtil.release(record);
query.release();
assertFalse(channel.finish());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testResponseEncode() do?
testResponseEncode() is a function in the netty codebase, defined in codec-dns/src/test/java/io/netty/handler/codec/dns/TcpDnsTest.java.
Where is testResponseEncode() defined?
testResponseEncode() is defined in codec-dns/src/test/java/io/netty/handler/codec/dns/TcpDnsTest.java at line 73.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free