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

您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > junit
junit使用簡明手冊
作者:網絡轉載 發布時間:[ 2014/2/18 14:18:29 ] 推薦標簽:junit 單元測試工具

junit是java中書寫unit test的framework,目前一些流行的unit test工具大都都是在junit上擴展而來的。本文針對的的版本是junit3.8.1,可以從www.junit.org上下載。新版本是junit4.1,一般新的myeclipse開發環境中都集成了的。

安裝

    First, download the latest version of JUnit, referred to below as junit.zip.

    Then install JUnit on your platform. of choice:

    Windows

    To install JUnit on Windows, follow these steps:

        Unzip the junit.zip distribution file to a directory referred to as %JUNIT_HOME%.

        Add JUnit to the classpath:

        set CLASSPATH=%CLASSPATH%;%JUNIT_HOME%junit.jar

    Unix (bash)

    To install JUnit on Unix, follow these steps:

        Unzip the junit.zip distribution file to a directory referred to as $JUNIT_HOME.

        Add JUnit to the classpath:

        export CLASSPATH=$CLASSPATH:$JUNIT_HOME/junit.jar

    (Optional) Unzip the $JUNIT_HOME/src.jar file.

    Test the installation by using either the textual or graphical test runner to run the sample tests distributed with JUnit.

    Note: The sample tests are not contained in the junit.jar, but in the installation directory directly. Therefore, make sure that the JUnit installation directory is in the CLASSPATH.

    For the textual TestRunner, type:

        java junit.textui.TestRunner junit.samples.AllTests

    For the graphical TestRunner, type:

        java junit.swingui.TestRunner junit.samples.AllTests

    All the tests should pass with an "OK" (textual) or a green bar (graphical).

    If the tests don't pass, verify that junit.jar is in the CLASSPATH.

    Finally, read the documentation.

用法

1.       基本使用步驟,Junit的使用非常簡單,它的基本使用步驟:

-          創建,從junit.framework.TestCase派生unit test需要的test case

-          書寫測試方法,提供類似于如下函數簽名的測試方法:

public void testXXXXX();

-          編譯,書寫完test case后,編譯所寫的test case類

-          運行,啟動junit test runner,來運行這個test case。

Junit提供了2個基本的test runner:字符界面和圖形界面。啟動命令分別如下:

a 圖形界面:

java junit.swingui.TestRunner XXXXX

b 字符界面:

java junit.textui.TestRunner XXXXX

上一頁123下一頁
軟件測試工具 | 聯系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 日韩成a人片在线观看日本 日韩操操操 | 亚洲人成网站在线观看播放动漫 | 欧美特黄三级在线观看 | 麻豆射区| 九九香蕉视频 | 免费黄色毛片视频 | 久久夜色精品国产亚洲 | 九九热免费视频 | 午夜高清在线观看 | 一区二区三区欧美 | 日韩中文网 | 草草在线视频 | 欧美色亚洲图 | 一个人看的www日本高清视频 | 国产成人爱情动作片在线观看 | 日韩免费一区二区三区 | 日韩免费观看的一级毛片 | 麻豆国产精品一二三在线观看 | 中国一级特黄真人毛片 | 国产三级在线 | 中国一级毛片aaa片 中国一级毛片 | 色视频网址 | 国产精品成人h视频 | 久久99精品久久久久久园产越南 | 欧美日韩第一区 | 日韩黄色免费 | 欧美高清videosex极品 | 91精品国产乱码在线观看 | 欧美日韩高清不卡一区二区三区 | 欧美一区二区二区 | 一级一级一级一级毛片 | aa级黄色大片 | 99精品国产第一福利网站 | 国产精品亚洲午夜不卡 | 欧美日韩精品在线播放 | 一级毛片大全 | 五月天天色 | 欧美日韩在线免费观看 | 久久国产一级毛片一区二区 | 精品国产第一国产综合精品 | 欧美日韩国产高清一区二区三区 |