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

您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > junit
ant+java+junit單獨配置
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2014/3/7 15:40:32 ] 推薦標簽:junit 配置

3)ant的build文件D:Banyanhellosrcexampleuild.xml

其內(nèi)容如下:

<?xml version="1.0" encoding="UTF-8" ?>
<project name="HelloWorld" default="junit" basedir=".">
<property name="src" value="."/>
<property name="dest" value="."/>
<property name="report" value="."/>
<target name="init">
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${dest}"/>
</target>
<target  name ="junit"  depends ="compile">
  <tstamp/>
  <junit  printsummary ="true">
   <formatter  type ="xml"/>
   <test name="HelloWorldTest" todir="."></test>
  </junit>
  <junitreport todir=".">
           <fileset dir=".">
            <include name="*.xml"/>
           </fileset>
           <report format="frames" todir="."/>
      </junitreport>
 </target>
</project>

4)在命令行切換到該目錄 (cd /d D:Banyanhellosrcexample)后,輸入

ant,有如下內(nèi)容:

D:Banyanhellosrcexample>ant
Buildfile: D:Banyanhellosrcexampleuild.xml

init:

compile:
    [javac] D:Banyanhellosrcexampleuild.xml:9: warning: 'includeantruntime
' was not set, defaulting to build.sysclasspath=last; set to false for repeatabl
e builds
    [javac] Compiling 1 source file to D:Banyanhellosrcexample

junit:
    [junit] Running HelloWorldTest
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.266 sec
[junitreport] the file D:BanyanhellosrcexampleTESTS-TestSuites.xml is not a
 valid testsuite XML document
[junitreport] the file D:Banyanhellosrcexampleuild.xml is not a valid test
suite XML document
[junitreport] Processing D:BanyanhellosrcexampleTESTS-TestSuites.xml to C:
DOCUME~1kortideLOCALS~1Temp ull281622628
[junitreport] Loading stylesheet jar:file:/F:/apache-ant-1.8.1/lib/ant-junit.jar
!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform. time: 1829ms
[junitreport] Deleting: C:DOCUME~1kortideLOCALS~1Temp ull281622628

BUILD SUCCESSFUL

Total time: 6 seconds

5)也可以不用ant,直接用junit測試,過程如下,切換到該目錄(cd /d D:Banyanhellosrcexample)后,編譯軟程序,直接測試。

javac HelloWorld.java

javac HelloWorldTest.java

執(zhí)行后,在D:Banyanhellosrcexample下會出現(xiàn)HelloWorld.class 和HelloWorldTest.class文件,然后再在命令行里輸入

java org.junit.runner.JUnitCore HelloWorldTest ,出現(xiàn)如下字符

JUnit version 4.8.2
.
Time: 0.016

OK (1 test)

測試完成。

上一頁123下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 欧美日韩亚洲一区二区 | 欧美一级淫片a免费播放口aaa | 黄网站视频观看免费 | 一区二区福利 | 在线看网站| 欧美三级在线 | 特级深夜a级毛片免费观看 特级中国aaa毛片 | 一区二区国产在线播放 | 亚洲免费二区三区 | 欧美怡红院免费全视频 | 91短视频在线观看手机 | 国产网站91 | 国产香蕉国产精品偷在线观看 | 成人开心网 | 欧美人体一区二区三区 | 日本三级精品 | 韩剧伦理在线观看 | 大香网伊人久久综合网2021 | 免费看的黄色大片 | 美女网站全黄 | 激情网五月天 | 国产啪视频 | 成人丁香| 亚洲福利天堂网福利在线观看 | 久久成人亚洲香蕉草草 | 波多野结衣久久精品 | 精品成人在线 | 日本伦理视频在线观看 | 黄色一级片观看 | 福利三级| 天天爽天天碰狠狠添 | 欧美日韩一日韩一线不卡 | 巨尻在线播放 | 亚欧视频在线观看 | 国产成人人人爆出白浆 | 高h啃咬花蒂 | 五月月色开心婷婷久久合 | 国产精品视频全国免费观看 | 伊人色综合琪琪久久社区 | 99re在线这里只有精品 | 成人网在线播放 |