Home / Class/ SmtpResponseDecoderTest Class — netty Architecture

SmtpResponseDecoderTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6523a881_9a13_c253_6379_f7921cefdfbf["SmtpResponseDecoderTest"]
  59e64ff9_b4a6_4ae7_a61a_930d29150ac8["SmtpResponseDecoderTest.java"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|defined in| 59e64ff9_b4a6_4ae7_a61a_930d29150ac8
  314034ee_a49d_b768_e957_964a1a87b178["testDecodeOneLineResponse()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 314034ee_a49d_b768_e957_964a1a87b178
  08961be2_5260_c6a4_7e34_57e110d1d92f["testDecodeOneLineResponseNoDetails()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 08961be2_5260_c6a4_7e34_57e110d1d92f
  3396f77b_b792_39ae_6b43_e0f92c8dbcc6["testDecodeOneLineResponseChunked()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 3396f77b_b792_39ae_6b43_e0f92c8dbcc6
  ebe6076b_7a2b_98e1_82eb_50e105ca5604["testDecodeTwoLineResponse()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| ebe6076b_7a2b_98e1_82eb_50e105ca5604
  3c3f9209_2846_cb95_463c_50bc6d18ef31["testDecodeTwoLineResponseChunked()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 3c3f9209_2846_cb95_463c_50bc6d18ef31
  e51cd914_2b45_7f37_e44d_bf3c3411cc24["testDecodeInvalidSeparator()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| e51cd914_2b45_7f37_e44d_bf3c3411cc24
  0e3b3fa9_d296_f22b_08f7_e617e21f4d1d["testDecodeInvalidCode()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 0e3b3fa9_d296_f22b_08f7_e617e21f4d1d
  07312687_d5e3_cd98_00b5_fbf8f73cd674["testDecodeInvalidLine()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 07312687_d5e3_cd98_00b5_fbf8f73cd674
  5047be9d_80db_9dab_79c9_5a6b97975101["EmbeddedChannel()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| 5047be9d_80db_9dab_79c9_5a6b97975101
  e996a67b_d0f5_87f5_8872_e43b85f5f67a["ByteBuf()"]
  6523a881_9a13_c253_6379_f7921cefdfbf -->|method| e996a67b_d0f5_87f5_8872_e43b85f5f67a

Relationship Graph

Source Code

codec-smtp/src/test/java/io/netty/handler/codec/smtp/SmtpResponseDecoderTest.java lines 34–154

public class SmtpResponseDecoderTest {

    @Test
    public void testDecodeOneLineResponse() {
        EmbeddedChannel channel = newChannel();
        assertTrue(channel.writeInbound(newBuffer("200 Ok\r\n")));
        assertTrue(channel.finish());

        SmtpResponse response = channel.readInbound();
        assertEquals(200, response.code());
        List<CharSequence> sequences = response.details();
        assertEquals(1, sequences.size());

        assertEquals("Ok", sequences.get(0).toString());
        assertNull(channel.readInbound());
    }

    @Test
    public void testDecodeOneLineResponseNoDetails() {
        EmbeddedChannel channel = newChannel();
        assertTrue(channel.writeInbound(newBuffer("250 \r\n")));
        assertTrue(channel.finish());

        SmtpResponse response = channel.readInbound();
        assertEquals(250, response.code());
        List<CharSequence> sequences = response.details();
        assertEquals(0, sequences.size());
    }

    @Test
    public void testDecodeOneLineResponseChunked() {
        EmbeddedChannel channel = newChannel();
        assertFalse(channel.writeInbound(newBuffer("200 Ok")));
        assertTrue(channel.writeInbound(newBuffer("\r\n")));
        assertTrue(channel.finish());

        SmtpResponse response = channel.readInbound();
        assertEquals(200, response.code());
        List<CharSequence> sequences = response.details();
        assertEquals(1, sequences.size());

        assertEquals("Ok", sequences.get(0).toString());
        assertNull(channel.readInbound());
    }

    @Test
    public void testDecodeTwoLineResponse() {
        EmbeddedChannel channel = newChannel();
        assertTrue(channel.writeInbound(newBuffer("200-Hello\r\n200 Ok\r\n")));
        assertTrue(channel.finish());

        SmtpResponse response = channel.readInbound();
        assertEquals(200, response.code());
        List<CharSequence> sequences = response.details();
        assertEquals(2, sequences.size());

        assertEquals("Hello", sequences.get(0).toString());
        assertEquals("Ok", sequences.get(1).toString());
        assertNull(channel.readInbound());
    }

    @Test
    public void testDecodeTwoLineResponseChunked() {
        EmbeddedChannel channel = newChannel();
        assertFalse(channel.writeInbound(newBuffer("200-")));
        assertFalse(channel.writeInbound(newBuffer("Hello\r\n2")));
        assertFalse(channel.writeInbound(newBuffer("00 Ok")));
        assertTrue(channel.writeInbound(newBuffer("\r\n")));
        assertTrue(channel.finish());

        SmtpResponse response = channel.readInbound();
        assertEquals(200, response.code());
        List<CharSequence> sequences = response.details();
        assertEquals(2, sequences.size());

        assertEquals("Hello", sequences.get(0).toString());
        assertEquals("Ok", sequences.get(1).toString());
        assertNull(channel.readInbound());
    }

    @Test

Frequently Asked Questions

What is the SmtpResponseDecoderTest class?
SmtpResponseDecoderTest is a class in the netty codebase, defined in codec-smtp/src/test/java/io/netty/handler/codec/smtp/SmtpResponseDecoderTest.java.
Where is SmtpResponseDecoderTest defined?
SmtpResponseDecoderTest is defined in codec-smtp/src/test/java/io/netty/handler/codec/smtp/SmtpResponseDecoderTest.java at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free