Home / Function/ testCachesClearedOnClose() — netty Function Reference

testCachesClearedOnClose() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e9b1cc30_38a7_d893_5b27_7d0dc204615e["testCachesClearedOnClose()"]
  b6215f36_0afe_a284_a3fd_3999e90a8e97["DnsNameResolverTest"]
  e9b1cc30_38a7_d893_5b27_7d0dc204615e -->|defined in| b6215f36_0afe_a284_a3fd_3999e90a8e97
  f68a278a_d1e5_7598_a2d3_c261c81029bc["get()"]
  e9b1cc30_38a7_d893_5b27_7d0dc204615e -->|calls| f68a278a_d1e5_7598_a2d3_c261c81029bc
  320a7bb7_1770_5812_3b9d_752bd44edf24["cache()"]
  e9b1cc30_38a7_d893_5b27_7d0dc204615e -->|calls| 320a7bb7_1770_5812_3b9d_752bd44edf24
  e0db6033_0923_3a43_22a1_11714277de6c["clear()"]
  e9b1cc30_38a7_d893_5b27_7d0dc204615e -->|calls| e0db6033_0923_3a43_22a1_11714277de6c
  style e9b1cc30_38a7_d893_5b27_7d0dc204615e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java lines 2762–2827

    @ParameterizedTest
    @EnumSource(DnsNameResolverChannelStrategy.class)
    @Timeout(value = 2000, unit = TimeUnit.MILLISECONDS)
    public void testCachesClearedOnClose(DnsNameResolverChannelStrategy strategy) throws Exception {
        final CountDownLatch resolveLatch = new CountDownLatch(1);
        final CountDownLatch authoritativeLatch = new CountDownLatch(1);

        DnsNameResolver resolver = newResolver(strategy).resolveCache(new DnsCache() {
            @Override
            public void clear() {
                resolveLatch.countDown();
            }

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

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

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

            @Override
            public DnsCacheEntry cache(
                    String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) {
                return null;
            }
        }).authoritativeDnsServerCache(new DnsCache() {
            @Override
            public void clear() {
                authoritativeLatch.countDown();
            }

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

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

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

            @Override
            public DnsCacheEntry cache(String hostname, DnsRecord[] additionals, Throwable cause, EventLoop loop) {
                return null;
            }
        }).build();

        resolver.close();
        resolveLatch.await();
        authoritativeLatch.await();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free