Package org.cedj.geekseek.service.smtp

Examples of org.cedj.geekseek.service.smtp.MailMessageBuilder


            }
        });

        // Construct and send the message async
        final MailMessageBuilder.MailMessage message =
                new MailMessageBuilder().from("alr@continuousdev.org").addTo("alr@continuousdev.org")
                        .subject("Test").body(body).contentType("text/plain").build();
        mailService.queueMailForDelivery(message);

        // Wait on the barrier until the message is received by the SMTP
        // server (pass) or the test times out (failure)
View Full Code Here


*/
public class MailMessageTestCase {

    @Test
    public void propsSet() {
        final MailMessageBuilder.MailMessage message = new MailMessageBuilder().
                from("from").addTo("to").subject("subject").body("body").
                contentType("contentType").build();
        Assert.assertEquals("from incorrect", "from", message.getFrom());
        Assert.assertEquals("to incorrect", "to", message.getTo()[0]);
        Assert.assertEquals("subject incorrect", "subject", message.getSubject());
View Full Code Here

        Assert.assertEquals("contentType incorrect", "contentType", message.getContentType());
    }

    @Test(expected = IllegalStateException.class)
    public void fromAddressRequired() {
        new MailMessageBuilder().addTo("to").subject("subject").body("body").contentType("contentType").build();
    }
View Full Code Here

        new MailMessageBuilder().addTo("to").subject("subject").body("body").contentType("contentType").build();
    }

    @Test(expected = IllegalStateException.class)
    public void toAddressRequired() {
        new MailMessageBuilder().from("from").subject("subject").body("body").contentType("contentType").build();
    }
View Full Code Here

        new MailMessageBuilder().from("from").subject("subject").body("body").contentType("contentType").build();
    }

    @Test(expected = IllegalStateException.class)
    public void subjectRequired() {
        new MailMessageBuilder().addTo("to").from("from").body("body").contentType("contentType").build();
    }
View Full Code Here

        new MailMessageBuilder().addTo("to").from("from").body("body").contentType("contentType").build();
    }

    @Test(expected = IllegalStateException.class)
    public void bodyRequired() {
        new MailMessageBuilder().from("from").addTo("to").subject("subject").contentType("contentType").build();
    }
View Full Code Here

        new MailMessageBuilder().from("from").addTo("to").subject("subject").contentType("contentType").build();
    }

    @Test(expected = IllegalStateException.class)
    public void contentTypeRequired() {
        new MailMessageBuilder().from("from").addTo("to").subject("subject").body("body").build();
    }
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.service.smtp.MailMessageBuilder

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.