qileilove

          blog已經轉移至github,大家請訪問 http://qaseven.github.io/

          TestNG基本注釋一:簡單實例

          一個簡單類的實例,指引你如何開始使用testng單元測試框架。
            使用的工具:
            TestNG 6.8.7
            Maven 3
            Eclipse IDE
            1.testng依賴
            在pom.xml中添加testng庫:
            pom.xml
          <dependency>
          <groupId>org.testng</groupId>
          <artifactId>testng</artifactId>
          <version>6.8.7</version>
          <scope>test</scope>
          </dependency>
            2.testng實例
          package test.java.com.testng.test;
          import org.testng.annotations.Test;
          import org.testng.annotations.BeforeMethod;
          import org.testng.annotations.AfterMethod;
          import org.testng.annotations.DataProvider;
          import org.testng.annotations.BeforeClass;
          import org.testng.annotations.AfterClass;
          import org.testng.annotations.BeforeTest;
          import org.testng.annotations.AfterTest;
          import org.testng.annotations.BeforeSuite;
          import org.testng.annotations.AfterSuite;
          public class LoginTest {
          @Test(dataProvider = "dp")
          public void f(Integer n, String s) {
          }
          @BeforeMethod
          public void beforeMethod() {
          }
          @AfterMethod
          public void afterMethod() {
          }
          @DataProvider
          public Object[][] dp() {
          return new Object[][] {
          new Object[] { 1, "a" },
          new Object[] { 2, "b" },
          };
          }
          @BeforeClass
          public void beforeClass() {
          }
          @AfterClass
          public void afterClass() {
          }
          @BeforeTest
          public void beforeTest() {
          }
          @AfterTest
          public void afterTest() {
          }
          @BeforeSuite
          public void beforeSuite() {
          }
          @AfterSuite
          public void afterSuite() {
          }
          }

          posted on 2014-02-08 10:42 順其自然EVO 閱讀(280) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2014年2月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          2324252627281
          2345678

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 南城县| 淅川县| 靖远县| 永清县| 永寿县| 右玉县| 响水县| 如东县| 盐城市| 通州市| 汤原县| 西城区| 宜兰市| 陆川县| 沂南县| 晋江市| 门源| 忻城县| 肇源县| 景泰县| 庆安县| 手游| 河池市| 武山县| 襄樊市| 永靖县| 泰和县| 织金县| 专栏| 兴城市| 宿州市| 潮安县| 达孜县| 仲巴县| 南通市| 保定市| 建湖县| 安溪县| 邯郸市| 伽师县| 灵宝市|