Home / File/ DefaultHostsFileEntriesResolverTest.java — netty Source File

DefaultHostsFileEntriesResolverTest.java — netty Source File

Architecture documentation for DefaultHostsFileEntriesResolverTest.java, a java file in the netty codebase.

File java Buffer Search 1 classes

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2016 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.resolver;

import io.netty.util.NetUtil;
import org.junit.jupiter.api.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.any;

public class DefaultHostsFileEntriesResolverTest {
    private static final Map<String, List<InetAddress>> LOCALHOST_V4_ADDRESSES =
            Collections.singletonMap("localhost", Collections.<InetAddress>singletonList(NetUtil.LOCALHOST4));
    private static final Map<String, List<InetAddress>> LOCALHOST_V6_ADDRESSES =
            Collections.singletonMap("localhost", Collections.<InetAddress>singletonList(NetUtil.LOCALHOST6));
    private static final long ENTRIES_TTL = TimeUnit.MINUTES.toNanos(1);

    /**
     * show issue https://github.com/netty/netty/issues/5182
     * HostsFileParser tries to resolve hostnames as case-sensitive
     */
    @Test
    public void testCaseInsensitivity() {
        DefaultHostsFileEntriesResolver resolver = new DefaultHostsFileEntriesResolver();
        //normalized somehow
        assertEquals(resolver.normalize("localhost"), resolver.normalize("LOCALHOST"));
    }

    @Test
// ... (135 more lines)

Domain

Subdomains

Frequently Asked Questions

What does DefaultHostsFileEntriesResolverTest.java do?
DefaultHostsFileEntriesResolverTest.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Search subdomain.
Where is DefaultHostsFileEntriesResolverTest.java in the architecture?
DefaultHostsFileEntriesResolverTest.java is located at resolver/src/test/java/io/netty/resolver/DefaultHostsFileEntriesResolverTest.java (domain: Buffer, subdomain: Search, directory: resolver/src/test/java/io/netty/resolver).

Analyze Your Own Codebase

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

Try Supermodel Free