ANT - JUnit集成指南说明书

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Properties
Description
dir
Where to invoke the VM from. This is ignored when fork is disabled.
jvm
Command used to invoke the JVM. This is ignored when fork is disabled.
Let us continue the theme of the Hello World Fax web application and add a JUnit target.
The following example shows a simple JUnit test execution:
<target name="unittest"> <junit haltonfailure="true" printsummary="true"> <test name="com.tutorialspoint.UtilsTest"/> </junit>
haltonerror
Stops execution when a test error occurs
haltonfailure Stops execution when a failure occurs
printsummary Advises Ant to display simple statistics for each test
Loading [MathJax]/jax/output/HTML-CSS/jax.js
ANT - JUNIT INTEGRATION
/ant/ant_junit_integration.htm
Copyright ©
JUnit is the commonly used unit testing framework for Java-based developments. It is easy to use and easy to extend. There are a number of JUnit extensions available. If you are unfamiliar with JUnit, you should download it from and read its manual. This chapter shows how to execute JUnit tests using Ant. Ant makes it straight forward through the JUnit task. The attributes of the JUnit task are presented below:
showoutput
Advises Ant to send the output to its logs and formatters
tempdir
Path to the temporary file that Ant will use
timeout
Exits the tests that take longer to run than this setting inmilliseconds.
fork
Runs the test in a separate JVM
errorproperty The name of the property to set if there is a JUnit error
failureproperty The name of the property to set if there is a JUnit failure
</பைடு நூலகம்arget>
This example shows the execution of JUnit on the com.tutorialspoint.UtilsTest junit class. Running the above code produces the following output:
test: [echo] Testing the application [junit] Running com.tutorialspoint.UtilsTest [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 16.2 sec BUILD PASSED
相关文档
最新文档