Home / Function/ testTimeoutNotCached() — netty Function Reference

testTimeoutNotCached() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7440ceda_506a_7a66_d730_0aca7bee87b7["testTimeoutNotCached()"]
  b6215f36_0afe_a284_a3fd_3999e90a8e97["DnsNameResolverTest"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|defined in| b6215f36_0afe_a284_a3fd_3999e90a8e97
  f68a278a_d1e5_7598_a2d3_c261c81029bc["get()"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|calls| f68a278a_d1e5_7598_a2d3_c261c81029bc
  320a7bb7_1770_5812_3b9d_752bd44edf24["cache()"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|calls| 320a7bb7_1770_5812_3b9d_752bd44edf24
  6379f5e9_9105_8ed2_288e_b124a4c8863f["InetSocketAddress()"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|calls| 6379f5e9_9105_8ed2_288e_b124a4c8863f
  df4510f5_88a8_20fd_2366_a4c543cdf3b8["resolve()"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|calls| df4510f5_88a8_20fd_2366_a4c543cdf3b8
  e0db6033_0923_3a43_22a1_11714277de6c["clear()"]
  7440ceda_506a_7a66_d730_0aca7bee87b7 -->|calls| e0db6033_0923_3a43_22a1_11714277de6c
  style 7440ceda_506a_7a66_d730_0aca7bee87b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java lines 2389–2436

    @ParameterizedTest
    @EnumSource(DnsNameResolverChannelStrategy.class)
    @Timeout(value = 3000, unit = TimeUnit.MILLISECONDS)
    public void testTimeoutNotCached(DnsNameResolverChannelStrategy strategy) {
        DnsCache cache = new DnsCache() {
            @Override
            public void clear() {
                // NOOP
            }

            @Override
            public boolean clear(String hostname) {
                return false;
            }

            @Override
            public List<? extends DnsCacheEntry> get(String hostname, DnsRecord[] additionals) {
                return Collections.emptyList();
            }

            @Override
            public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, InetAddress address,
                                       long originalTtl, EventLoop loop) {
                fail("Should not be cached");
                return null;
            }

            @Override
            public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) {
                fail("Should not be cached");
                return null;
            }
        };
        DnsNameResolverBuilder builder = newResolver(strategy);
        builder.queryTimeoutMillis(100)
                .authoritativeDnsServerCache(cache)
                .resolveCache(cache)
                .nameServerProvider(new SingletonDnsServerAddressStreamProvider(
                        new InetSocketAddress(NetUtil.LOCALHOST, 12345)));
        DnsNameResolver resolver = builder.build();
        Future<InetAddress> result = resolver.resolve("doesnotexist.netty.io").awaitUninterruptibly();
        Throwable cause = result.cause();
        assertInstanceOf(UnknownHostException.class, cause);
        assertInstanceOf(DnsNameResolverTimeoutException.class, cause.getCause());
        assertTrue(DnsNameResolver.isTimeoutError(cause));
        assertTrue(DnsNameResolver.isTransportOrTimeoutError(cause));
        resolver.close();
    }

Domain

Subdomains

Frequently Asked Questions

What does testTimeoutNotCached() do?
testTimeoutNotCached() is a function in the netty codebase, defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java.
Where is testTimeoutNotCached() defined?
testTimeoutNotCached() is defined in resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java at line 2389.
What does testTimeoutNotCached() call?
testTimeoutNotCached() calls 5 function(s): InetSocketAddress, cache, clear, get, resolve.

Analyze Your Own Codebase

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

Try Supermodel Free