Package mireka.smtp

Examples of mireka.smtp.MailSystemStatus


            "Delivery not authorized, message refused";

    @Test
    public void testCreateResponseLookingForEnhancedStatusCode_original() {
        Response srcResponse = new Response(500, ENHANCED_EXAMPLE);
        MailSystemStatus basicResponse =
                new ResponseParser()
                        .createResponseLookingForEnhancedStatusCode(srcResponse);
        assertThat(basicResponse, instanceOf(EnhancedStatus.class));
        EnhancedStatus enhancedResponse = (EnhancedStatus) basicResponse;
        assertEquals("5.7.1", enhancedResponse.getEnhancedStatusCode());
View Full Code Here


    }

    @Test
    public void testCreateResponseLookingForEnhancedStatusCode_enhanced() {
        Response srcResponse = new Response(500, ORIGINAL_EXAMPLE);
        MailSystemStatus basicResponse =
                new ResponseParser()
                        .createResponseLookingForEnhancedStatusCode(srcResponse);
        assertThat(basicResponse, instanceOf(Rfc821Status.class));

        assertEquals("Delivery not authorized, message refused", basicResponse
                .getMessage());
        assertEquals(500, basicResponse.getSmtpReplyCode());
    }
View Full Code Here

    @Test
    public void testOneLineNoEnhanced() {
        Response response = new Response(CODE500, "Example error");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(Rfc821Status.class, mailSystemStatus.getClass());
        assertEquals(CODE500, mailSystemStatus.getSmtpReplyCode());
        assertEquals("Example error", mailSystemStatus.getMessage());
    }
View Full Code Here

    @Test
    public void testMultiLineNoEnhanced() {
        Response response =
                new Response(CODE500, "Example error\r\nSecond line");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(Rfc821Status.class, mailSystemStatus.getClass());
        assertEquals(CODE500, mailSystemStatus.getSmtpReplyCode());
        assertEquals("Example error\r\nSecond line", mailSystemStatus
                .getMessage());
    }
View Full Code Here

    @Test
    public void testSingleLineEnhanced() {
        Response response = new Response(CODE500, "5.0.0 Example error");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(EnhancedStatus.class, mailSystemStatus.getClass());
        assertEquals(CODE500, mailSystemStatus.getSmtpReplyCode());
        assertEquals("Example error", mailSystemStatus.getMessage());
        assertEquals("5.0.0", ((EnhancedStatus) mailSystemStatus)
                .getEnhancedStatusCode());
    }
View Full Code Here

    public void testMultiLineEnhanced() {
        Response response =
                new Response(CODE500,
                        "5.0.0 Example error\r\n5.0.0 Second line");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(EnhancedStatus.class, mailSystemStatus.getClass());
        assertEquals(CODE500, mailSystemStatus.getSmtpReplyCode());
        assertEquals("Example error\r\nSecond line", mailSystemStatus
                .getMessage());
        assertEquals("5.0.0", ((EnhancedStatus) mailSystemStatus)
                .getEnhancedStatusCode());
    }
View Full Code Here

    @Test
    public void testMultigitEnhancedCode() {
        Response response = new Response(CODE500, "5.10.100 Example error");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals("5.10.100", ((EnhancedStatus) mailSystemStatus)
                .getEnhancedStatusCode());
View Full Code Here

    @Test
    public void testEnhancedCodeInvalidBecause0Padded() {
        Response response = new Response(CODE500, "5.01.0 Example error");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(Rfc821Status.class, mailSystemStatus.getClass());
        assertEquals("5.01.0 Example error", mailSystemStatus.getMessage());
    }
View Full Code Here

    @Test
    public void testEnhancedCodeInconsistent() {
        Response response =
                new Response(CODE500, "5.0.0 error\r\nMissing code!");

        MailSystemStatus mailSystemStatus =
                statusFactory
                        .createResponseLookingForEnhancedStatusCode(response);

        assertEquals(Rfc821Status.class, mailSystemStatus.getClass());
        assertEquals("5.0.0 error\r\nMissing code!", mailSystemStatus
                .getMessage());
    }
View Full Code Here

TOP

Related Classes of mireka.smtp.MailSystemStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.