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)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 永嘉县| 湟中县| 万源市| 乳源| 沐川县| 黄冈市| 原平市| 宣汉县| 安西县| 公主岭市| 宣化县| 黑河市| 眉山市| 保亭| 高碑店市| 溧阳市| 仪征市| 虹口区| 凤台县| 鞍山市| 教育| 孙吴县| 鄯善县| 台南县| 贵港市| 两当县| 邵阳县| 兰考县| 罗山县| 北川| 江永县| 花莲市| 万源市| 阿坝| 万载县| 平塘县| 新宾| 含山县| 巩义市| 临泽县| 凉山|