Package com.icegreen.greenmail.util

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


      //use random content to avoid potential residual lingering problems
      String subject = GreenMailUtil.random();
      String body = GreenMailUtil.random();
      GreenMailUtil.sendTextEmailTest("test@localhost.com", "from@localhost.com", subject, body);

      Assert.assertTrue( greenMail.waitForIncomingEmail(5000, 1) );

      MockMessageProducer messageProducer = new MockMessageProducer();

      MailReceiverConfig configuration = new MailReceiverConfig();
      configuration.setPort(ServerSetupTest.IMAP.getPort());
View Full Code Here


      mimeMessage.setContent(mp);

      Transport.send(mimeMessage);

      Assert.assertTrue( greenMail.waitForIncomingEmail(5000, 1) );

      MockMessageProducer messageProducer = new MockMessageProducer();

      MailReceiverConfig configuration = new MailReceiverConfig();
      configuration.setPort(ServerSetupTest.SMTP.getPort());
View Full Code Here

        System.out.println();
       
        while (true) {
            int c = greenMail.getReceivedMessages().length;

            if (greenMail.waitForIncomingEmail(Long.MAX_VALUE, c + 1)) {
                MimeMessage message = greenMail.getReceivedMessages()[c++];
                System.out.println("Received mail to " + message.getRecipients(RecipientType.TO)[0]);
                System.out.println();
                System.out.println(message.getContent());
                System.out.println("-------------------------------------------------------");
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.