Eclipse TestNG
来源:互联网 发布:mac无苹果安装win7系统 编辑:程序博客网 时间:2024/06/09 18:52
1.安装TestNG 插件
在Eclipse Marketplace里安装插件,目前最新插件是6.9版本,要求的JDK是1.7,,否则会不能执行。
这里指定JDK,
2.编写测试代码:
此项目基于Spring 的maven工程:
@ContextConfiguration(locations = { "classpath*:config/spring/spring-aop.xml", "classpath*:config/spring/spring-web.xml", "classpath*:config/spring/spring-dal.xml", "classpath*:spring-datasource-test.xml", "classpath*:config/spring/spring-init.xml", "classpath*:config/spring/spring-tsp-framework.xml", "classpath*:config/spring/spring-cache.xml", "classpath:config/spring/spring-tsp.xml", "classpath*:config/spring/spring-jms.xml", "classpath*:config/spring/spring-log.xml" })@Testpublic class BaseTest extends AbstractTestNGSpringContextTests {}上面的@ContextConfiguration用来配置数据源等信息
此时可以编写测试类:
public class IDiyServiceTest extends BaseTest {@Resource( name = "diyServiceImpl" )private IDiyService iDiyService; @Test public void testGetDiyInfoByProductId() { ProductDetailRequestVo productDetailRequestVo=new ProductDetailRequestVo(); productDetailRequestVo.setProductType(2); productDetailRequestVo.setProductId(5004635); productDetailRequestVo.setRequestSourceCode(2); ResponseVo resp=iDiyService.getDiyInfoByProductId(productDetailRequestVo); Assert.notNull(resp.getData()); }
0 0
- TestNG + Eclipse
- Eclipse TestNG
- TestNg Eclipse插件
- Eclipse安装TestNG插件
- selenium+testng+junit+eclipse
- TestNG Eclipse插件
- Eclipse安装testng插件
- Eclipse TestNG环境
- TestNG Eclipse插件
- Eclipse 安装testNG
- Eclipse TestNg插件
- TestNG eclipse 插件安装
- eclipse离线安装testNG
- eclipse安装TestNg插件
- Eclipse安装TestNG插件
- Eclipse安装TestNG
- Eclipse离线安装TestNG
- Eclipse如何安装testng
- IOS XIB--持续更新
- (大数据之sqoop)sqoop的安装及常用操作
- 这个快排是不是很简洁呢...
- 25个git进阶技巧
- SQLite3中自增主键归零方法
- Eclipse TestNG
- apt-get常用命令
- 关于字符串能不能修改,重指向的问题解释
- 剑指offer 16- 反转链表
- 西安治疗纤维瘤去哪个医院
- openssl入门编程
- Vijos-P1097-合并果子(简单贪心 && 优先队列 && c++)
- 逼真黑客范儿–Hacker Typer
- php创建接口出现乱码 encode urldecode转换程字符串