Home / Class/ NetUtilTest Class — netty Architecture

NetUtilTest Class — netty Architecture

Architecture documentation for the NetUtilTest class in NetUtilTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  545234a8_c93e_9bed_bd0e_6c5542a33149["NetUtilTest"]
  247fd383_8be2_1ea5_3be7_e0f229bce586["NetUtilTest.java"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|defined in| 247fd383_8be2_1ea5_3be7_e0f229bce586
  ba4519a0_db91_0314_1ba3_80220b476ac6["testLocalhost()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| ba4519a0_db91_0314_1ba3_80220b476ac6
  c8c1679d_f2e1_a023_12bd_bbe2adcf5359["testLoopback()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| c8c1679d_f2e1_a023_12bd_bbe2adcf5359
  d1c160cf_669c_133f_2925_723b4edb5103["testIsValidIpV4Address()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| d1c160cf_669c_133f_2925_723b4edb5103
  bdd9fee2_cd38_ac16_2b75_432f7b25710e["testIsValidIpV6Address()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| bdd9fee2_cd38_ac16_2b75_432f7b25710e
  06142012_fd41_9640_ba6a_aed42b3fe4c3["testCreateByteArrayFromIpAddressString()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| 06142012_fd41_9640_ba6a_aed42b3fe4c3
  b7654612_3703_48f1_af3b_cd833bbac5ea["testBytesToIpAddress()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| b7654612_3703_48f1_af3b_cd833bbac5ea
  87c2b511_70a8_efd2_00c6_2a2f690c700f["testBytesToIpAddressWithOffset()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| 87c2b511_70a8_efd2_00c6_2a2f690c700f
  b6d20c2f_9eea_f08f_ed23_91c42a8910d2["copyWithOffset()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| b6d20c2f_9eea_f08f_ed23_91c42a8910d2
  04242566_8c5e_b45b_acb7_06960dd56906["testIp6AddressToString()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| 04242566_8c5e_b45b_acb7_06960dd56906
  43f59d63_168b_7177_4abb_b6c3ab3e1db2["testIp4AddressToString()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| 43f59d63_168b_7177_4abb_b6c3ab3e1db2
  b2db6f8b_2548_31e4_6427_0581affb0966["testIPv4ToInt()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| b2db6f8b_2548_31e4_6427_0581affb0966
  be0754e8_85ec_b9c0_79d1_648f7eb3c597["testIpv4MappedIp6GetByName()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| be0754e8_85ec_b9c0_79d1_648f7eb3c597
  632b6915_a62a_7c10_5a0c_710177655560["testInvalidIpv4MappedIp6GetByName()"]
  545234a8_c93e_9bed_bd0e_6c5542a33149 -->|method| 632b6915_a62a_7c10_5a0c_710177655560

Relationship Graph

Source Code

common/src/test/java/io/netty/util/NetUtilTest.java lines 37–820

public class NetUtilTest {

    private static final class TestMap extends HashMap<String, String> {
        private static final long serialVersionUID = -298642816998608473L;

        TestMap(String... values) {
            for (int i = 0; i < values.length; i += 2) {
                String key = values[i];
                String value = values[i + 1];
                put(key, value);
            }
        }
    }

    private static final Map<String, String> validIpV4Hosts = new TestMap(
            "192.168.1.0",     "c0a80100",
            "10.255.255.254",  "0afffffe",
            "172.18.5.4",      "ac120504",
            "0.0.0.0",         "00000000",
            "127.0.0.1",       "7f000001",
            "255.255.255.255", "ffffffff",
            "1.2.3.4",         "01020304");

    private static final Map<String, String> invalidIpV4Hosts = new TestMap(
            "1.256.3.4",     null,
            "256.0.0.1",     null,
            "1.1.1.1.1",     null,
            "x.255.255.255", null,
            "0.1:0.0",       null,
            "0.1.0.0:",      null,
            "127.0.0.",      null,
            "1.2..4",        null,
            "192.0.1",       null,
            "192.0.1.1.1",   null,
            "192.0.1.a",     null,
            "19a.0.1.1",     null,
            "a.0.1.1",       null,
            ".0.1.1",        null,
            "127.0.0",       null,
            "192.0.1.256",   null,
            "0.0.200.259",   null,
            "1.1.-1.1",      null,
            "1.1. 1.1",      null,
            "1.1.1.1 ",      null,
            "1.1.+1.1",      null,
            "0.0x1.0.255",   null,
            "0.01x.0.255",   null,
            "0.x01.0.255",   null,
            "0.-.0.0",       null,
            "0..0.0",        null,
            "0.A.0.0",       null,
            "0.1111.0.0",    null,
            "...",           null);

    private static final Map<String, String> validIpV6Hosts = new TestMap(
            "::ffff:5.6.7.8",                            "00000000000000000000ffff05060708",
            "fdf8:f53b:82e4::53",                        "fdf8f53b82e400000000000000000053",
            "fe80::200:5aee:feaa:20a2",                  "fe8000000000000002005aeefeaa20a2",
            "2001::1",                                   "20010000000000000000000000000001",
            "2001:0000:4136:e378:8000:63bf:3fff:fdd2",   "200100004136e378800063bf3ffffdd2",
            "2001:0002:6c::430",                         "20010002006c00000000000000000430",
            "2001:10:240:ab::a",                         "20010010024000ab000000000000000a",
            "2002:cb0a:3cdd:1::1",                       "2002cb0a3cdd00010000000000000001",
            "2001:db8:8:4::2",                           "20010db8000800040000000000000002",
            "ff01:0:0:0:0:0:0:2",                        "ff010000000000000000000000000002",
            "[fdf8:f53b:82e4::53]",                      "fdf8f53b82e400000000000000000053",
            "[fe80::200:5aee:feaa:20a2]",                "fe8000000000000002005aeefeaa20a2",
            "[2001::1]",                                 "20010000000000000000000000000001",
            "[2001:0000:4136:e378:8000:63bf:3fff:fdd2]", "200100004136e378800063bf3ffffdd2",
            "0:1:2:3:4:5:6:789a",                        "0000000100020003000400050006789a",
            "0:1:2:3::f",                                "0000000100020003000000000000000f",
            "0:0:0:0:0:0:10.0.0.1",                      "00000000000000000000ffff0a000001",
            "0:0:0:0:0::10.0.0.1",                       "00000000000000000000ffff0a000001",
            "0:0:0:0::10.0.0.1",                         "00000000000000000000ffff0a000001",
            "::0:0:0:0:0:10.0.0.1",                      "00000000000000000000ffff0a000001",
            "0::0:0:0:0:10.0.0.1",                       "00000000000000000000ffff0a000001",
            "0:0::0:0:0:10.0.0.1",                       "00000000000000000000ffff0a000001",
            "0:0:0::0:0:10.0.0.1",                       "00000000000000000000ffff0a000001",
            "0:0:0:0::0:10.0.0.1",                       "00000000000000000000ffff0a000001",
            "0:0:0:0:0:ffff:10.0.0.1",                   "00000000000000000000ffff0a000001",
            "::ffff:192.168.0.1",                        "00000000000000000000ffffc0a80001",

Frequently Asked Questions

What is the NetUtilTest class?
NetUtilTest is a class in the netty codebase, defined in common/src/test/java/io/netty/util/NetUtilTest.java.
Where is NetUtilTest defined?
NetUtilTest is defined in common/src/test/java/io/netty/util/NetUtilTest.java at line 37.

Analyze Your Own Codebase

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

Try Supermodel Free