1   package com.ozacc.mail.impl;
2   
3   import junit.framework.TestCase;
4   
5   import org.apache.log4j.BasicConfigurator;
6   
7   import com.ozacc.mail.Mail;
8   import com.ozacc.mail.MailBuilder;
9   
10  /***
11   * SendMailProImpl¥¯¥é¥¹¤Î¥Æ¥¹¥È¥±¡¼¥¹¡£¼ÂºÝ¤ËÁ÷¿®¤·¡¢¥á¡¼¥é¡¼¤Ç¼õ¿®¤·¤Æ³Îǧ¤¹¤?¥Æ¥¹¥È¤Ç¤¹¡£
12   * 
13   * @author Tomohiro Otsuka
14   * @version $Id: SendMailProImplRealTest.java,v 1.1.2.1 2005/01/23 06:51:27 otsuka Exp $
15   */
16  public class SendMailProImplRealTest extends TestCase {
17  
18  	private MailBuilder builder;
19  
20  	private String email;
21  
22  	private String envelopeTo;
23  
24  	private SendMailProImpl sendMail;
25  
26  	/*
27  	 * @see TestCase#setUp()
28  	 */
29  	protected void setUp() throws Exception {
30  		super.setUp();
31  
32  		BasicConfigurator.configure();
33  
34  		email = "to@example.com";
35  		envelopeTo = "to@example.com";
36  
37  		String host = "localhost";
38  		sendMail = new SendMailProImpl(host);
39  		sendMail.setMessageId("example.com");
40  
41  		builder = new XMLMailBuilderImpl();
42  	}
43  
44  	/***
45  	 * @see junit.framework.TestCase#tearDown()
46  	 */
47  	protected void tearDown() throws Exception {
48  		BasicConfigurator.resetConfiguration();
49  	}
50  
51  	/*	public void testSendMailWithAttachmentInputStream() throws Exception {
52  	 String classPath = "/com/ozacc/mail/test-mail4.xml";
53  	 Mail mail = builder.buildMail(classPath);
54  	 mail.addTo(email);
55  
56  	 File image1 = new File("src/test/com/ozacc/mail/image1.jpg");
57  	 FileInputStream fis = new FileInputStream(image1);
58  
59  	 mail.addFile(fis, "ÌûÖÚ²èÁ?.jpg");
60  	 mail.setSubject("źÉÕ¥Õ¥¡¥¤¥?¤ÎInputStreamÁ÷¿®¥Æ¥¹¥È");
61  
62  	 sendMail.connect();
63  	 sendMail.send(mail);
64  	 sendMail.disconnect();
65  	 }
66  
67  	 public void testSendMailEnvelopeTo() throws Exception {
68  	 String classPath = "/com/ozacc/mail/test-mail4.xml";
69  	 Mail mail = builder.buildMail(classPath);
70  	 mail.addTo(email);
71  	 mail.addEnvelopeTo(envelopeTo);
72  
73  	 sendMail.connect();
74  	 sendMail.send(mail);
75  	 sendMail.disconnect();
76  	 }*/
77  
78  	/***
79  	 * ¥Æ¥¹¥È¥±¡¼¥¹¤¬¤Ò¤È¤Ä¤â¤Ê¤¤¤È¥¨¥é¡¼¤Ë¤Ê¤?¤Î¤Ç¡¢¥À¥ß¡¼¡£
80  	 */
81  	public void testSendMailSuccess() {
82  		Mail mail;
83  		assertTrue(true);
84  	}
85  
86  }