Home / Function/ testNsLoopFailsResolve() — netty Function Reference

testNsLoopFailsResolve() — netty Function Reference

Architecture documentation for the testNsLoopFailsResolve() function in DnsNameResolverTest.java from the netty codebase.

Function java Buffer Search calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  c3633681_e320_2eff_fee8_cef101f3b6e9["testNsLoopFailsResolve()"]
  b6215f36_0afe_a284_a3fd_3999e90a8e97["DnsNameResolverTest"]
  c3633681_e320_2eff_fee8_cef101f3b6e9 -->|defined in| b6215f36_0afe_a284_a3fd_3999e90a8e97
  25909e57_5202_1496_6e8e_39e3c7868cdd["testNsLoopFailsResolveWithAuthoritativeDnsServerCache()"]
  25909e57_5202_1496_6e8e_39e3c7868cdd -->|calls| c3633681_e320_2eff_fee8_cef101f3b6e9
  fc199d30_b0ec_23dc_7d46_a0c2b1d65036["testNsLoopFailsResolveWithoutAuthoritativeDnsServerCache()"]
  fc199d30_b0ec_23dc_7d46_a0c2b1d65036 -->|calls| c3633681_e320_2eff_fee8_cef101f3b6e9
  df4510f5_88a8_20fd_2366_a4c543cdf3b8["resolve()"]
  c3633681_e320_2eff_fee8_cef101f3b6e9 -->|calls| df4510f5_88a8_20fd_2366_a4c543cdf3b8
  e0db6033_0923_3a43_22a1_11714277de6c["clear()"]
  c3633681_e320_2eff_fee8_cef101f3b6e9 -->|calls| e0db6033_0923_3a43_22a1_11714277de6c
  style c3633681_e320_2eff_fee8_cef101f3b6e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java lines 2092–2131

    private void testNsLoopFailsResolve(DnsNameResolverChannelStrategy strategy,
                                        AuthoritativeDnsServerCache authoritativeDnsServerCache) throws Exception {
        final String domain = "netty.io";
        final String ns1Name = "ns1." + domain;
        final String ns2Name = "ns2." + domain;

        TestDnsServer testDnsServer = new TestDnsServer(new HashSet<String>(
                Collections.singletonList(domain))) {

            @Override
            protected DnsMessage filterMessage(DnsMessage message) {
                // Just always return NS records only without any additional records (glue records).
                // Because of this the resolver will never be able to resolve and so fail eventually at some
                // point.
                for (QuestionRecord record: message.getQuestionRecords()) {
                    if (record.getDomainName().equals(domain)) {
                        message.getAdditionalRecords().clear();
                        message.getAnswerRecords().clear();
                        message.getAuthorityRecords().add(TestDnsServer.newNsRecord(domain, ns1Name));
                        message.getAuthorityRecords().add(TestDnsServer.newNsRecord(domain, ns2Name));
                    }
                }
                return message;
            }
        };
        testDnsServer.start();
        DnsNameResolverBuilder builder = newResolver(strategy);

        final DnsNameResolver resolver = builder.resolveCache(NoopDnsCache.INSTANCE)
                .authoritativeDnsServerCache(authoritativeDnsServerCache)
                .nameServerProvider(new SingletonDnsServerAddressStreamProvider(testDnsServer.localAddress())).build();

        try {
            assertInstanceOf(UnknownHostException.class, resolver.resolve(domain).await().cause());
            assertInstanceOf(UnknownHostException.class, resolver.resolveAll(domain).await().cause());
        } finally {
            resolver.close();
            testDnsServer.stop();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testNsLoopFailsResolve() do?
testNsLoopFailsResolve() is a function in the netty codebase, defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java.
Where is testNsLoopFailsResolve() defined?
testNsLoopFailsResolve() is defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java at line 2092.
What does testNsLoopFailsResolve() call?
testNsLoopFailsResolve() calls 2 function(s): clear, resolve.
What calls testNsLoopFailsResolve()?
testNsLoopFailsResolve() is called by 2 function(s): testNsLoopFailsResolveWithAuthoritativeDnsServerCache, testNsLoopFailsResolveWithoutAuthoritativeDnsServerCache.

Analyze Your Own Codebase

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

Try Supermodel Free