testsendmail.java

来自「找回密码的程序」· Java 代码 · 共 43 行

JAVA
43
字号
package test;

import junit.framework.*;
import password.*;

/**这是SendMail的JUNIT测试类.
 * <p>Title: 项目实战 Stage2</p>
 *
 * <p>Description: ACCP 4.0</p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: jb-aptech.com.cn</p>
 *
 * @author Dong Ping
 * @version 1.0
 */
public class TestSendMail extends TestCase {
    private SendMail sendMail = null;

    protected void setUp() throws Exception {
        super.setUp();
        /**@todo verify the constructors*/
        sendMail = new SendMail();
    }

    protected void tearDown() throws Exception {
        sendMail = null;
        super.tearDown();
    }

    public void testSendnow() throws Exception {
        sendMail.setMsgText("Hello this is test");
        sendMail.setFrom("ping.dong@jb-aptech.com.cn");
        sendMail.setTo("ping.dong@jb-aptech.com.cn");
        sendMail.setSmtpHost("mailsvr.jv.jb-aptech.com.cn");
        sendMail.setSubject("test mail");
        sendMail.sendnow();
        /**@todo fill in the test code*/
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?