Examples of MimeProperties


Examples of com.google.appengine.tck.mail.support.MimeProperties

    @Test
    public void testSendAndReceiveBasicMessage() throws Exception {
        assumeEnvironment(Environment.APPSPOT, Environment.CAPEDWARF);

        MimeProperties mp = new MimeProperties();
        mp.subject = "Basic-Message-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-basic-test", EmailMessageField.FROM);
        mp.to = getEmail("to-basic-test", EmailMessageField.TO);
        mp.body = BODY;
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

        assumeEnvironment(Environment.APPSPOT, Environment.CAPEDWARF);

        final String textBody = "I am bold.";
        final String htmlBody = "<html><body><b>I am bold.</b></body></html>";

        MimeProperties mp = new MimeProperties();
        mp.subject = "Full-Message-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-full", EmailMessageField.FROM);
        mp.to = getEmail("to-test-full", EmailMessageField.TO);
        mp.cc = getEmail("cc-test-full", EmailMessageField.CC);
        mp.bcc = getEmail("bcc-test-full", EmailMessageField.BCC);
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

    @Test
    public void testValidAttachment() throws Exception {
        assumeEnvironment(Environment.APPSPOT, Environment.CAPEDWARF);

        MimeProperties mp = new MimeProperties();
        mp.subject = "Valid-Attachment-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-valid-attachment", EmailMessageField.FROM);
        mp.to = getEmail("to-test-valid-attachment", EmailMessageField.TO);

        MailService.Attachment attachment = createValidAttachment();
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

    }

    @Test
    public void testInvalidAttachment() throws Exception {
        for (String extension : getInvalidAttachmentFileTypes()) {
            MimeProperties mp = new MimeProperties();
            mp.subject = "Invalid-Attachment-Test-" + extension + System.currentTimeMillis();
            mp.from = getEmail("from-test-invalid-attachment", EmailMessageField.FROM);
            mp.to = getEmail("to-test-invalid-attachment", EmailMessageField.TO);

            MailService.Attachment attachment = createInvalidAttachment(extension);
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

        return new MailService.Attachment("test-attach." + extension, bytes);
    }

    @Test
    public void testBounceNotification() throws Exception {
        MimeProperties mp = new MimeProperties();
        mp.subject = "Bounce-Notification-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-bounce", EmailMessageField.FROM);
        mp.to = getEmail("to-test-bounce", EmailMessageField.TO) + "bogus";
        mp.body = BODY;
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

    @Test
    public void testAllowedHeaders() throws Exception {
        assumeEnvironment(Environment.APPSPOT, Environment.CAPEDWARF);

        MimeProperties mp = new MimeProperties();
        mp.subject = "Allowed-Headers-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-header", EmailMessageField.FROM);
        mp.to = getEmail("to-test-header", EmailMessageField.TO);
        mp.body = BODY;

        MailService.Message msg = createMailServiceMessage(mp);
        msg.setTextBody(BODY);

        // https://developers.google.com/appengine/docs/java/mail/#Sending_Mail_with_Headers
        Set<MailService.Header> headers = new HashSet<>();
        Map<String, String> headersMap = createExpectedHeaders();

        for (Map.Entry entry : headersMap.entrySet()) {
            headers.add(new MailService.Header(entry.getKey().toString(), entry.getValue().toString()));
        }
        msg.setHeaders(headers);
        mailService.send(msg);

        MimeProperties receivedMp = pollForMatchingMail(mp);
        assertHeadersExist(receivedMp, createExpectedHeadersVerifyList(headersMap));
    }
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

        Session session = instance(Session.class);
        if (session == null) {
            session = Session.getDefaultInstance(new Properties(), null);
        }
        MimeProperties mp = new MimeProperties();
        mp.subject = "Javax-Transport-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-x", EmailMessageField.FROM);
        mp.to = getEmail("to-test-x", EmailMessageField.TO);
        mp.body = BODY;
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

        assumeEnvironment(Environment.APPSPOT, Environment.CAPEDWARF);

        final String textBody = "I am bold.";
        final String htmlBody = "<html><body><b>I am bold.</b></body></html>";

        MimeProperties mp = new MimeProperties();
        mp.subject = "Automatic-Html-To-Text-Conversion-Test-" + System.currentTimeMillis();
        mp.from = getEmail("from-test-htmltext", EmailMessageField.FROM);
        mp.to = getEmail("to-test-htmltext", EmailMessageField.TO);
        mp.multiPartsList.add(textBody);
        mp.multiPartsList.add(htmlBody);
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

        }
        return adminTestingAccount;
    }

    private void assertSenderAuthorized(String sender) throws IOException {
        MimeProperties mp = new MimeProperties();
        mp.subject = "Test-Authorized-Sender-" + System.currentTimeMillis();
        mp.from = sender;
        mp.to = getEmail("to-authorized-sender-test", EmailMessageField.TO);
        mp.body = BODY;
View Full Code Here

Examples of com.google.appengine.tck.mail.support.MimeProperties

            }
        }
    }

    private void assertSenderUnauthorized(String unauthorizedSender) throws IOException {
        MimeProperties mp = new MimeProperties();
        mp.subject = "Test-Unauthorized-Sender-" + System.currentTimeMillis();
        mp.from = unauthorizedSender;
        mp.to = getEmail("to-unauthorized-sender-test", EmailMessageField.TO);
        mp.body = BODY;
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.