Home / Class/ XmlFrameDecoderTest Class — netty Architecture

XmlFrameDecoderTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  13b85bd7_07cb_814c_1ac0_dcb1adb68947["XmlFrameDecoderTest"]
  ad376d41_d78a_4580_f2a1_233d85c452ab["XmlFrameDecoderTest.java"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|defined in| ad376d41_d78a_4580_f2a1_233d85c452ab
  05c82d7b_8717_582e_0dfd_4a3fd4b9b254["XmlFrameDecoderTest()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 05c82d7b_8717_582e_0dfd_4a3fd4b9b254
  c1184d51_ddb2_0a53_967a_684af1bb4603["testConstructorWithIllegalArgs01()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| c1184d51_ddb2_0a53_967a_684af1bb4603
  684db4a7_6c6b_9791_e3ba_12d3177f9934["testConstructorWithIllegalArgs02()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 684db4a7_6c6b_9791_e3ba_12d3177f9934
  d50c7a4d_0ca8_39ad_c566_6fbf22c80f60["testDecodeWithFrameExceedingMaxLength()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| d50c7a4d_0ca8_39ad_c566_6fbf22c80f60
  52d4f34d_bcf8_dcb3_e54f_7b9f55edd884["testDecodeWithInvalidInput()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 52d4f34d_bcf8_dcb3_e54f_7b9f55edd884
  35a5867f_1f66_f7b8_39ac_f0f2c7cc0eaa["testDecodeWithInvalidContentBeforeXml()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 35a5867f_1f66_f7b8_39ac_f0f2c7cc0eaa
  cb7dbe25_1a39_5d7b_099a_0363b7fbc37a["testDecodeShortValidXml()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| cb7dbe25_1a39_5d7b_099a_0363b7fbc37a
  5ceb042f_e29f_e8e7_d2d4_f20a4ae36581["testDecodeShortValidXmlWithLeadingWhitespace01()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 5ceb042f_e29f_e8e7_d2d4_f20a4ae36581
  e14cd8ef_e599_1d24_8ecd_853dbfad433e["testDecodeShortValidXmlWithLeadingWhitespace02()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| e14cd8ef_e599_1d24_8ecd_853dbfad433e
  907f7aec_3fda_73e8_5f00_973337219035["testDecodeShortValidXmlWithLeadingWhitespace02AndTrailingGarbage()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 907f7aec_3fda_73e8_5f00_973337219035
  2f230c3a_abb9_389a_d104_3340b09fd8d0["testDecodeInvalidXml()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 2f230c3a_abb9_389a_d104_3340b09fd8d0
  798f0e09_9a49_2e9f_26d4_dbf77c94af2c["testDecodeWithCDATABlock()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 798f0e09_9a49_2e9f_26d4_dbf77c94af2c
  9a4fd67e_b079_7fc0_4717_c4c8655073eb["testDecodeWithCDATABlockContainingNestedUnbalancedXml()"]
  13b85bd7_07cb_814c_1ac0_dcb1adb68947 -->|method| 9a4fd67e_b079_7fc0_4717_c4c8655073eb

Relationship Graph

Source Code

codec-xml/src/test/java/io/netty/handler/codec/xml/XmlFrameDecoderTest.java lines 43–229

public class XmlFrameDecoderTest {

    private final List<String> xmlSamples;

    public XmlFrameDecoderTest() throws IOException, URISyntaxException {
        xmlSamples = Arrays.asList(
                sample("01"), sample("02"), sample("03"),
                sample("04"), sample("05"), sample("06")
        );
    }

    @Test
    public void testConstructorWithIllegalArgs01() {
        assertThrows(IllegalArgumentException.class, new Executable() {
            @Override
            public void execute() {
                new XmlFrameDecoder(0);
            }
        });
    }

    @Test
    public void testConstructorWithIllegalArgs02() {
        assertThrows(IllegalArgumentException.class, new Executable() {
            @Override
            public void execute() {
                new XmlFrameDecoder(-23);
            }
        });
    }

    @Test
    public void testDecodeWithFrameExceedingMaxLength() {
        XmlFrameDecoder decoder = new XmlFrameDecoder(3);
        final EmbeddedChannel ch = new EmbeddedChannel(decoder);
        assertThrows(TooLongFrameException.class, new Executable() {
            @Override
            public void execute() {
                ch.writeInbound(Unpooled.copiedBuffer("<v/>", CharsetUtil.UTF_8));
            }
        });
    }

    @Test
    public void testDecodeWithInvalidInput() {
        XmlFrameDecoder decoder = new XmlFrameDecoder(1048576);
        final EmbeddedChannel ch = new EmbeddedChannel(decoder);
        assertThrows(CorruptedFrameException.class, new Executable() {
            @Override
            public void execute() {
                ch.writeInbound(Unpooled.copiedBuffer("invalid XML", CharsetUtil.UTF_8));
            }
        });
    }

    @Test
    public void testDecodeWithInvalidContentBeforeXml() {
        XmlFrameDecoder decoder = new XmlFrameDecoder(1048576);
        final EmbeddedChannel ch = new EmbeddedChannel(decoder);
        assertThrows(CorruptedFrameException.class, new Executable() {
            @Override
            public void execute() throws Throwable {
                ch.writeInbound(Unpooled.copiedBuffer("invalid XML<foo/>", CharsetUtil.UTF_8));
            }
        });
    }

    @Test
    public void testDecodeShortValidXml() {
        testDecodeWithXml("<xxx/>", "<xxx/>");
    }

    @Test
    public void testDecodeShortValidXmlWithLeadingWhitespace01() {
        testDecodeWithXml("   <xxx/>", "<xxx/>");
    }

    @Test
    public void testDecodeShortValidXmlWithLeadingWhitespace02() {
        testDecodeWithXml("  \n\r \t<xxx/>\t", "<xxx/>");
    }

Frequently Asked Questions

What is the XmlFrameDecoderTest class?
XmlFrameDecoderTest is a class in the netty codebase, defined in codec-xml/src/test/java/io/netty/handler/codec/xml/XmlFrameDecoderTest.java.
Where is XmlFrameDecoderTest defined?
XmlFrameDecoderTest is defined in codec-xml/src/test/java/io/netty/handler/codec/xml/XmlFrameDecoderTest.java at line 43.

Analyze Your Own Codebase

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

Try Supermodel Free