Package com.icegreen.greenmail.user

Examples of com.icegreen.greenmail.user.GreenMailUser.deliver()


        // whether users are identified by email or name alone)
        // in which case try retrieving by EMAIL rather than USER
        userManager.createUser(email, user, password);
        GreenMailUser gmUser = userManager.getUser(user);
        assert null != gmUser;
        gmUser.deliver(message);
    }

    public static MimeMessage toMessage(String text, String email, String charset) throws MessagingException
    {
        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
View Full Code Here


        GreenMailUser target = userManager.getUser(user);
        if (null == target)
        {
            throw new IllegalStateException("Failure in greenmail - see comments in test code.");
        }
        target.deliver((MimeMessage) message);
        Thread.sleep(STARTUP_PERIOD_MS);
    }

    protected void createBobAndStoreEmail(Object message) throws Exception
    {
View Full Code Here

                    GreenMailUser user = userManager.getUserByEmail(mailAddress.getEmail());
                    if (null == user) {
                        user = userManager.createUser(mailAddress.getEmail(),mailAddress.getEmail(), mailAddress.getEmail());
                    }

                    user.deliver(msg);

                } catch (UserException e) {
                    throw new RuntimeException(e);
                }
            } catch (Exception e) {
View Full Code Here

        // (there is some confusion in the greenmail code about
        // whether users are identified by email or name alone)
        // in which case try retrieving by EMAIL rather than USER
        logger.debug("Creating mail user " + user + "/" + email + "/" + password);
        GreenMailUser target = createUser(email, user, password);
        target.deliver((MimeMessage) message);
        Thread.sleep(STARTUP_PERIOD_MS);
    }

    public GreenMailUser createUser(String email, String user, String password) throws UserException
    {
View Full Code Here

        if(gmUser == null || gmUser.getEmail() != email || gmUser.getPassword() != password){
            userManager.createUser(email, user, password);
            gmUser = userManager.getUser(user);
        }
        assert null != gmUser;
        gmUser.deliver(message);
    }

    public static MimeMessage toMessage(String text, String email, String charset) throws MessagingException
    {
        MimeMessage message = new MimeMessage(Session.getDefaultInstance(new Properties()));
View Full Code Here

        Multipart multipart = new MimeMultipart();
        multipart.addBodyPart(messagePart);

        message.setContent(multipart);

        user.deliver(message);
    }

    @AfterClass
    public static void stopServers() throws Exception {
        imapServer.stop();
View Full Code Here

        multipart.addBodyPart(messagePart);
        multipart.addBodyPart(attachmentPart);

        message.setContent(multipart);

        user.deliver(message);
    }

    @Override
    protected void doSetUp() throws Exception {
        super.doSetUp();
View Full Code Here

        Multipart multipart = new MimeMultipart();
        multipart.addBodyPart(messagePart);

        message.setContent(multipart);

        user.deliver(message);
    }

    @AfterClass
    public static void stopServers() throws Exception {
        imapServer.stop();
View Full Code Here

        Multipart multipart = new MimeMultipart();
        multipart.addBodyPart(messagePart);

        message.setContent(multipart);

        user.deliver(message);
    }

    @AfterClass
    public static void stopServers() throws Exception {
        imapServer.stop();
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.