Home / Function/ testContains() — netty Function Reference

testContains() — netty Function Reference

Architecture documentation for the testContains() function in DefaultHeadersTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  dac6738a_2bd6_e9f0_1b67_5b8349c52eb0["testContains()"]
  0eee3d0f_600b_7083_6b8d_273d78e59928["DefaultHeadersTest"]
  dac6738a_2bd6_e9f0_1b67_5b8349c52eb0 -->|defined in| 0eee3d0f_600b_7083_6b8d_273d78e59928
  style dac6738a_2bd6_e9f0_1b67_5b8349c52eb0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/DefaultHeadersTest.java lines 225–273

    @Test
    public void testContains() {
        TestDefaultHeaders headers = newInstance();
        headers.addBoolean(of("boolean"), true);
        assertTrue(headers.containsBoolean(of("boolean"), true));
        assertFalse(headers.containsBoolean(of("boolean"), false));

        headers.addLong(of("long"), Long.MAX_VALUE);
        assertTrue(headers.containsLong(of("long"), Long.MAX_VALUE));
        assertFalse(headers.containsLong(of("long"), Long.MIN_VALUE));

        headers.addInt(of("int"), Integer.MIN_VALUE);
        assertTrue(headers.containsInt(of("int"), Integer.MIN_VALUE));
        assertFalse(headers.containsInt(of("int"), Integer.MAX_VALUE));

        headers.addShort(of("short"), Short.MAX_VALUE);
        assertTrue(headers.containsShort(of("short"), Short.MAX_VALUE));
        assertFalse(headers.containsShort(of("short"), Short.MIN_VALUE));

        headers.addChar(of("char"), Character.MAX_VALUE);
        assertTrue(headers.containsChar(of("char"), Character.MAX_VALUE));
        assertFalse(headers.containsChar(of("char"), Character.MIN_VALUE));

        headers.addByte(of("byte"), Byte.MAX_VALUE);
        assertTrue(headers.containsByte(of("byte"), Byte.MAX_VALUE));
        assertFalse(headers.containsLong(of("byte"), Byte.MIN_VALUE));

        headers.addDouble(of("double"), Double.MAX_VALUE);
        assertTrue(headers.containsDouble(of("double"), Double.MAX_VALUE));
        assertFalse(headers.containsDouble(of("double"), Double.MIN_VALUE));

        headers.addFloat(of("float"), Float.MAX_VALUE);
        assertTrue(headers.containsFloat(of("float"), Float.MAX_VALUE));
        assertFalse(headers.containsFloat(of("float"), Float.MIN_VALUE));

        long millis = System.currentTimeMillis();
        headers.addTimeMillis(of("millis"), millis);
        assertTrue(headers.containsTimeMillis(of("millis"), millis));
        // This test doesn't work on midnight, January 1, 1970 UTC
        assertFalse(headers.containsTimeMillis(of("millis"), 0));

        headers.addObject(of("object"), "Hello World");
        assertTrue(headers.containsObject(of("object"), "Hello World"));
        assertFalse(headers.containsObject(of("object"), ""));

        headers.add(of("name"), of("value"));
        assertTrue(headers.contains(of("name"), of("value")));
        assertFalse(headers.contains(of("name"), of("value1")));
    }

Domain

Subdomains

Frequently Asked Questions

What does testContains() do?
testContains() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/DefaultHeadersTest.java.
Where is testContains() defined?
testContains() is defined in codec-base/src/test/java/io/netty/handler/codec/DefaultHeadersTest.java at line 225.

Analyze Your Own Codebase

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

Try Supermodel Free