亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > TestNG
TestNG之執(zhí)行順序
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2016/1/5 11:21:48 ] 推薦標(biāo)簽:軟件測試工具 單元測試工具

  如果很有個(gè)測試方法,并且這幾個(gè)方法又有先后順序,那么如果讓TestNG按照自己想要的方法執(zhí)行呢
  一、通過Dependencies
  1.在測試類中添加Dependencies
@Test
public void test1() {
System.out.println("this is test1");
}
@Test(dependsOnMethods = { "test1" })
public void test2() {
System.out.println("this is test2");
}
@Test(dependsOnMethods = { "test2" })
public void test3() {
System.out.println("this is test3");
}
@Test(dependsOnMethods = { "test3" })
public void test4() {
System.out.println("this is test4");
}
@Test(dependsOnMethods = { "test4" })
public void test5() {
System.out.println("this is test5");
}
  執(zhí)行順序,print:
  this is test1
  this is test2
  this is test3
  this is test4
  this is test5
  2.在xml文件中添加Dependencies,代碼中無需再添加Dependencies
<test name="Test">
<classes>
<class name="test.testng.TestOrder"/>
<methods>
<dependencies>
<method name="test2" depends-on="test1"/>
<method name="test3" depends-on="test2"/>
<method name="test4" depends-on="test3"/>
<method name="test5" depends-on="test4"/>
<method name="test1" />
</dependencies>
</methods>
</classes>
</test>
  執(zhí)行順序,打印結(jié)果:
  this is test1
  this is test2
  this is test3
  this is test4
  this is test5

上一頁12下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 免费超爽大片黄 | 成人免费www在线高清观看 | 激情综合激情 | 97人人做人人爽人人喊 | 在线看片a | 国产日韩欧美视频在线观看 | 700av第一福利在线导航 | 精品国产一区二区三区国产馆 | 国产自在自线午夜精品视频在 | 老妇激情毛片免费 | 免费啪视频 | 黄色三级在线 | 你懂的视频在线播放 | 亚洲欧美专区 | 日韩成人综合网 | 亚洲日本一区二区 | 国产 欧美日韩 在线播放 | 老湿影院免费在线观看 | 91香蕉 | 成人1000部免费观看视频 | 精品国产日韩亚洲一区二区 | 成人夜间视频 | 国产91在线 | 亚洲 | 免费羞羞网站 | 看全色黄大色黄女片爽毛片 | 欧美激情精品久久久久 | 深夜福利动态 | 国产99在线播放免费 | 国产精品视频大全 | 国产高清视频在线播放 | 在线日韩亚洲 | 最近中文字幕免费4 | 国产日韩欧美亚洲综合在线 | 欧美视频高清在线观看 | 日日碰日日操 | 放荡的美妇一区二区三区 | 99精品国产成人一区二区 | 国产高清视频 | 波多野结衣一区2区3区 | 一级做a爱片在线播放 | 国产 在线 | 日韩 |