Home / Function/ testUrlDecoding() — netty Function Reference

testUrlDecoding() — netty Function Reference

Architecture documentation for the testUrlDecoding() function in QueryStringDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0d179d47_c29d_e6af_20c8_b8b269a72c12["testUrlDecoding()"]
  eb06d5ec_240d_301a_c763_6ea4da90a16b["QueryStringDecoderTest"]
  0d179d47_c29d_e6af_20c8_b8b269a72c12 -->|defined in| eb06d5ec_240d_301a_c763_6ea4da90a16b
  style 0d179d47_c29d_e6af_20c8_b8b269a72c12 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java lines 214–249

    @Test
    public void testUrlDecoding() throws Exception {
        final String caffe = new String(
                // "Caffé" but instead of putting the literal E-acute in the
                // source file, we directly use the UTF-8 encoding so as to
                // not rely on the platform's default encoding (not portable).
                new byte[] {'C', 'a', 'f', 'f', (byte) 0xC3, (byte) 0xA9},
                StandardCharsets.UTF_8);
        final String[] tests = {
            // Encoded   ->   Decoded or error message substring
            "",               "",
            "foo",            "foo",
            "f+o",            "f o",
            "f++",            "f  ",
            "fo%",            "unterminated escape sequence at index 2 of: fo%",
            "%42",            "B",
            "%5f",            "_",
            "f%4",            "unterminated escape sequence at index 1 of: f%4",
            "%x2",            "invalid hex byte 'x2' at index 1 of '%x2'",
            "%4x",            "invalid hex byte '4x' at index 1 of '%4x'",
            "Caff%C3%A9",     caffe,
            "случайный праздник",               "случайный праздник",
            "случайный%20праздник",             "случайный праздник",
            "случайный%20праздник%20%E2%98%BA", "случайный праздник ☺",
        };
        for (int i = 0; i < tests.length; i += 2) {
            final String encoded = tests[i];
            final String expected = tests[i + 1];
            try {
                final String decoded = QueryStringDecoder.decodeComponent(encoded);
                assertEquals(expected, decoded);
            } catch (IllegalArgumentException e) {
                assertEquals(expected, e.getMessage());
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testUrlDecoding() do?
testUrlDecoding() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java.
Where is testUrlDecoding() defined?
testUrlDecoding() is defined in codec-http/src/test/java/io/netty/handler/codec/http/QueryStringDecoderTest.java at line 214.

Analyze Your Own Codebase

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

Try Supermodel Free