Eclipse离线安装TestNG插件

离线安装TestNG插件:

 

受网络等因素影响,在线安装方式速度比较慢,可以通过如下方式离线安装TestNG插件。

 

1、通过浏览器直接访问网址, http://beust.com/eclipse

2、点击最下面的链接 zipped/

3、页面显示有如下版本

6.10.0.201612030230/

6.11.0.201703011520/

6.12.0.201709030110/

6.12.0.201709050550/

6.9.10.201512240000/

6.9.11.201604020423/

6.9.12.201607091356/

6.9.13.201609291640/

6.9.5.201505251947/

 

在eclipse(luna)经过测试,6.10 和 6.11 支持离线安装,而6.12版本不支持,可能luna还没有相关testng的库可以提供

 

4、这里选择版本:“6.10.0.201612030230/”

 

5、点击 site_assembly.zip  下载

 

6、将安装文件解压至eclipse的dropin目录后重启Eclipse完成插件安装

 

 

测试代码:

package test.testnGg;

import org.testng.annotations.*;

public class SimpleTest {
 
 @BeforeClass
 public void setUp() {
   // code that will be invoked when this test is instantiated
 }
 
 @Test(groups = { "fast" })
 public void aFastTest() {
   System.out.println("Fast test");
 }
 
 @Test(groups = { "slow" })
 public void aSlowTest() {
    System.out.println("Slow test");
 }
 
 @Test(threadPoolSize = 100, invocationCount = 500,  timeOut = 10000)
 public void testServer(){
	 System.out.println(Thread.currentThread().getId()+":"+Thread.currentThread().getName());
 }
}

 

 

右键选择Outline 的testServer 方法->debug as ->TestNG test 开始测试

 

参考:http://www.cnblogs.com/xusweeter/p/6559196.html

 

 

 

 

猜你喜欢

转载自zhouchaofei2010.iteye.com/blog/2398367
今日推荐