聚沙成塔

-Iftp功能单元测试示例

上一篇 / 下一篇  2013-05-06 19:31:58 / 个人分类:单元测试

package com.new.sapi.protocol;
import java.io.IOException;
import org.junit.Before;
import org.junit.After;
import org.junit.Test;
import static org.junit.Assert;
import com.new.sapi.ServiceAccess;

/*** 测试nt和linux系统下ftp的连接功能***/
public void FtpConnectTest {
         FTPService ftp_nt = null;
FTPService ftp_linux = null;
 
@Before
public void setUp() throws Exception {
   ftp_nt = ServiceAcess.getFTPService(); 
            ftp_linux = ServiceAcess.getFTPService();
}
 
@After
public void tearDown() throws Exception {
    ftp_nt.disConnect();
     ftp_linux.disConnect();
}
 
/**
 *Test method for {@link com.new.sapi.protocol.FTPService#connect(java.lang.String,java.lang.String,java.lang.String)}
 **/ 
@Test
public void testConnectStringStringString() {
     try {
     assertTrue(ftp_nt.connect("10.129.124.61","iconsole","123456"));
 assertTrue(ftp_linux.connect("10.129.172.25","jos","jos"));
 } catch (IOException e) {
     e.printStackTrace();
}
 
}
 
}

TAG: JUnit Junit JUNIT junit

 

评分:0

我来说两句

Open Toolbar