Examples of Email


Examples of org.springmodules.email.Email

        resource = new ClassPathResource("/org/springmodules/email/parser/test.xml");
    }

    public void testParse() throws Exception {

        Email email = parser.parse(resource);
        assertNotNull(email);

        Map headers = email.getHeaders();
        assertNotNull(headers);
        assertEquals(1, headers.size());
        assertTrue(headers.containsKey("test"));
        assertEquals("10", headers.get("test"));

        InternetAddress address = email.getFrom();
        assertNotNull(address);
        assertEquals("From", address.getPersonal());
        assertEquals("from@springmodules.org", address.getAddress());

        InternetAddress[] addresses = email.getTo();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("To", addresses[0].getPersonal());
        assertEquals("to1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("to2@springmodules.org", addresses[1].getAddress());

        addresses = email.getCc();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("Cc", addresses[0].getPersonal());
        assertEquals("cc1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("cc2@springmodules.org", addresses[1].getAddress());

        addresses = email.getBcc();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("Bcc", addresses[0].getPersonal());
        assertEquals("bcc1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("bcc2@springmodules.org", addresses[1].getAddress());

        assertEquals("HIGH", email.getPriority().getName());

        address = email.getReplyTo();
        assertNotNull(address);
        assertEquals("Reply To", address.getPersonal());
        assertEquals("replyto@springmodules.org", address.getAddress());

        assertEquals("subject", email.getSubject());

        assertEquals("Some text body", email.getTextBody());

        assertEquals("<html><body>Some html body</body></html>", email.getHtmlBody());

        Set attachments = email.getAttachments();
        assertFalse(attachments.isEmpty());
        Iterator iter = attachments.iterator();
        Attachment attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());
        attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());

        attachments = email.getInlineAttachments();
        assertFalse(attachments.isEmpty());
        iter = attachments.iterator();
        attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());
View Full Code Here

Examples of org.springmodules.email.Email

        dispatcher.setDispachingCallback(callback);
        dispatcher.setEncoding("UTF-8");
    }

    public void testSend() throws Exception {
        Email email = new Email();

        TestExecutor executor = new TestExecutor(email);
        dispatcher.setTaskExecutor(executor);

        callback.emailDispatched(email, true);
View Full Code Here

Examples of org.springmodules.email.Email

        callbackControl.verify();
        emailSenderControl.verify();
    }

    public void testSend_WithError() throws Exception {
        Email email = new Email();

        TestExecutor executor = new TestExecutor(email);
        dispatcher.setTaskExecutor(executor);

        MailException error = new MailException("Error") {};
View Full Code Here

Examples of org.springmodules.email.Email

        resource = new ClassPathResource("/org/springmodules/email/conf/test.xml");
    }

    public void testParse() throws Exception {

        Email email = parser.parse(resource);
        assertNotNull(email);

        InternetAddress address = email.getFrom();
        assertNotNull(address);
        assertEquals("From", address.getPersonal());
        assertEquals("from@springmodules.org", address.getAddress());

        InternetAddress[] addresses = email.getTo();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("To", addresses[0].getPersonal());
        assertEquals("to1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("to2@springmodules.org", addresses[1].getAddress());

        addresses = email.getCc();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("Cc", addresses[0].getPersonal());
        assertEquals("cc1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("cc2@springmodules.org", addresses[1].getAddress());

        addresses = email.getBcc();
        assertNotNull(addresses);
        assertEquals(2, addresses.length);
        assertEquals("Bcc", addresses[0].getPersonal());
        assertEquals("bcc1@springmodules.org", addresses[0].getAddress());
        assertNull(addresses[1].getPersonal());
        assertEquals("bcc2@springmodules.org", addresses[1].getAddress());

        assertEquals("HIGH", email.getPriority().getName());

        address = email.getReplyTo();
        assertNotNull(address);
        assertEquals("Reply To", address.getPersonal());
        assertEquals("replyto@springmodules.org", address.getAddress());

        assertEquals("subject", email.getSubject());

        assertEquals("Some text body", email.getTextBody());

        assertEquals("<html><body>Some html body</body></html>", email.getHtmlBody());

        Set attachments = email.getAttachments();
        assertFalse(attachments.isEmpty());
        Iterator iter = attachments.iterator();
        Attachment attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());
        attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());

        attachments = email.getInlineAttachments();
        assertFalse(attachments.isEmpty());
        iter = attachments.iterator();
        attachment = (Attachment)iter.next();
        assertTrue("attachment1".equals(attachment.getName()) || "attachment2".equals(attachment.getName()));
        assertEquals("test.xml", attachment.getResource().getFilename());
View Full Code Here

Examples of org.springmodules.validation.bean.conf.loader.annotation.handler.Email

        super(Email.class);
    }

    @Override
    public String convertToValang(String fieldName, Annotation a, MessageSourceAccessor messages) {
        Email annotation = (Email) a;

        String errMsg = messages.getMessage(annotation.errorCode(), annotation.message());
        String applyIfValang = valangToJS(annotation.applyIf());

        StringBuffer sb = new StringBuffer();
        sb.append(" function() {return this.equals((this.EmailFunction(this.getPropertyValue(");
        sb.append(wrapAndEscapeJsString(fieldName)); // name
        sb.append("))), (true))}");
View Full Code Here

Examples of org.uddi.api_v2.Email

                List<Email> r = new ArrayList<Email>();
                if (email == null) {
                        return r;
                }
                for (int i = 0; i < email.size(); i++) {
                        Email x = new Email();
                        x.setUseType(email.get(i).getUseType());
                        x.setValue(email.get(i).getValue());
                        r.add(x);
                }
               
                return r;
        }
View Full Code Here

Examples of org.uddi.api_v3.Email

   * @param useType
   * @return
   */
  public static Email generateEmail (String value, String useType)
  {
    Email email = new Email();
    email.setValue(value);
    if (useType != null)
      email.setUseType(useType);
   
    return email;
  }
View Full Code Here

Examples of pt.utl.ist.fenix.tools.util.EMail

        String messageBody =
                RenderUtils.getFormatedResourceString("ALUMNI_RESOURCES", "message.alumni.mail.person.data", mailArgs);
        mailBody.append(messageBody);
        mailBody.append("\n\n").append(BundleUtil.getString(Bundle.ALUMNI, "message.alumni.mail.body.footer"));
        EMail email = null;
        try {
            if (!request.getServerName().equals("localhost")) {
                email = new EMail("mail.adm", "erro@dot.ist.utl.pt");
                String aluminiEmailAddress = Installation.getInstance().getInstituitionalEmailAddress("alumni");
                email.send(aluminiEmailAddress, "Erro Registo Alumni", mailBody.toString());
            }
        } catch (Throwable t) {
            logger.error(t.getMessage(), t);
            throw new Error(t);
        }
View Full Code Here

Examples of quickfix.fix42.Email

                }
            }
        };

        quickfixjEngine.addEventListener(messageListener);
        Email email = TestSupport.createEmailMessage("Test");
        Session.sendToTarget(email, initiatorSessionID);

        assertTrue("Application message not received", messageLatch.await(5000, TimeUnit.MILLISECONDS));
        quickfixjEngine.removeEventListener(messageListener);
View Full Code Here

Examples of quickfix.fix42.Email

            1000L, Long.class)).thenReturn(5000L);
               
        org.apache.camel.Message mockOutboundCamelMessage = Mockito.mock(org.apache.camel.Message.class);
        Mockito.when(mockExchange.getOut()).thenReturn(mockOutboundCamelMessage);
       
        final Message outboundFixMessage = new Email();
        outboundFixMessage.getHeader().setString(SenderCompID.FIELD, "TARGET");
        outboundFixMessage.getHeader().setString(TargetCompID.FIELD, "SENDER");
       
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doAnswer(new Answer<Boolean>() {
            @Override
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.