Package com.icegreen.greenmail.util

Examples of com.icegreen.greenmail.util.GreenMail.start()


    int port = TestProperties.getInteger("email.server.port");
    log.info("Starting; port: {}", port);

    GreenMail server = new GreenMail(new ServerSetup(port, null, ServerSetup.PROTOCOL_SMTP));
    server.setUser("system@nexus.org", "smtp-username", "smtp-password");
    server.start();

    this.server = server;
  }

  public void stopServer() {
View Full Code Here


            description = "Test a sample request and a response for E-mail host object")
    public void testEmail() {
        ClientConnectionUtil.waitForPort(9763);

        GreenMail greenMail = new GreenMail(ServerSetupTest.SMTP);
        greenMail.start();

        String finalOutput = null;

        try {
            URL jaggeryURL = new URL("http://localhost:9763/testapp/email.jag");
View Full Code Here

            description = "Test a sample request and a response for E-mail host object")
    public void testSendEmail() {
        ClientConnectionUtil.waitForPort(9763);

        GreenMail greenMail = new GreenMail(ServerSetupTest.SMTP);
        greenMail.start();

        String finalOutput = null;
        try {
            URL jaggeryURL = new URL("http://localhost:9763/testapp/email.jag");
            URLConnection jaggeryServerConnection = jaggeryURL.openConnection();
View Full Code Here

            description = "Test a sample request and a subject of the response for E-mail host object")
    public void testSendEmailSubject() {
        ClientConnectionUtil.waitForPort(9763);

        GreenMail greenMail = new GreenMail(ServerSetupTest.SMTP);
        greenMail.start();

        String subject = null;
        try {
            URL jaggeryURL = new URL("http://localhost:9763/testapp/email.jag");
            URLConnection jaggeryServerConnection = jaggeryURL.openConnection();
View Full Code Here

public class MailReceiverTest {

  @Test(enabled=false)
  public void shouldReceiveImapEmail() throws Exception {
    GreenMail greenMail = new GreenMail(ServerSetupTest.ALL);
    greenMail.start();

    try {
      //use random content to avoid potential residual lingering problems
      String subject = GreenMailUtil.random();
      String body = GreenMailUtil.random();
View Full Code Here

  }

  @Test(enabled=false)
  public void shouldRetrieveTextFromMultipartMessage() throws Exception {
    GreenMail greenMail = new GreenMail(ServerSetupTest.ALL);
    greenMail.start();

    try {
      //use random content to avoid potential residual lingering problems
      String subject = GreenMailUtil.random();
      String body = GreenMailUtil.random();
View Full Code Here

  }

  @Test
  public void shouldTimeoutIfInvalidPort() throws Exception {
    GreenMail greenMail = new GreenMail();
    greenMail.start();

    MailReceiverConfig configuration = new MailReceiverConfig();
    configuration.setPort(3996);

    MailReceiver receiver = new MailReceiver(configuration);
View Full Code Here

    public static void main(String[] args) throws Exception {
        ServerSetup setup = new ServerSetup(3025, "localhost", "smtp");

        GreenMail greenMail = new GreenMail(setup);
        greenMail.start();

        System.out.println("Started mail server (localhost:3025)");
        System.out.println();
       
        while (true) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.