Package org.jboss.seam.mail.ui

Examples of org.jboss.seam.mail.ui.UIMessage


          @Override
          protected void invokeApplication() throws Exception
          {
             UIAttachment attachment = new UIAttachment();
             attachment.setFileName("filename.pdf");
             UIMessage message = new UIMessage();
             attachment.setParent(message);
             message.setMailSession(MailSession.instance());
             DocumentData doc = new ByteArrayDocumentData("filename", new DocumentData.DocumentType("pdf", "application/pdf"), new byte[] {});
             attachment.setValue(doc);
             attachment.encodeEnd(FacesContext.getCurrentInstance());
            
             // verify we built the message
             Assert.assertEquals(message.getAttachments().size(), 1);
             MimeBodyPart bodyPart = message.getAttachments().get(0);
             Assert.assertEquals(bodyPart.getFileName(), "filename.pdf");
             Assert.assertEquals(bodyPart.getDisposition(),"attachment");
          }
       }.run();
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.mail.ui.UIMessage

Copyright © 2018 www.massapicom. 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.