1 package info.magnolia.cms.mail; 2 3 import info.magnolia.cms.mail.templates.MailAttachment; 4 5 import java.io.File ; 6 import java.net.URL ; 7 8 import org.slf4j.Logger; 9 import org.slf4j.LoggerFactory; 10 11 12 public class AttachmentMailTest extends AbstractMailTest { 13 14 Logger log = LoggerFactory.getLogger(AttachmentMailTest.class); 15 16 public void testAttachmentFile() throws Exception { 17 String file = getResourcePath(TEST_FILE_PDF); 18 MailAttachment att = new MailAttachment(new File (file).toURL(), "att"); 19 URL url = att.getURL(); 20 log.info(url.toString()); 21 File f = att.getFile(); 22 log.info(f.getAbsolutePath()); 23 assertTrue(f.exists()); 24 assertEquals(f.getAbsolutePath(), file); 25 } 26 27 } 28 | Popular Tags |