使用Maven2进行单元测试
来源:互联网 发布:手机淘宝卖家推荐 编辑:程序博客网 时间:2024/05/21 13:55
Now let's test the application. A few simple test classes can be found in the source code. Unit testing is (or should be!) an important part of any enterprise Java application. Maven completely integrates unit testing into the development lifecycle. To run all your unit tests, you invoke the test
lifecycle phase:
现在来测试应用程序,在源代码中可以找到一些简单测试类。单元测试是(或者应该是)任何企业java应用程序的重要组成部分。Maven将单元测试完全集成进了开发生命周期。要运行所有的单元测试,可以调用test生命周期阶段:
mvn test
If you want to run only one test, you can use the test
parameter:
如果你只想运行某个单元测试,可以使用test参数指定:
mvn test -Dtest=HotelModelTest
A nice feature of Maven 2 is its use of regular expressions and the test
parameter to control the tests you want to run. If you want to run only one test, you just indicate the name of the test class:
Maven 2的一个特性是test参数使用规则表达式来运行测试,如果只想运行某个测试,你只要指出测试类的名称就可以了:
mvn test -Dtest=HotelModelTest
If you want to run only a subset of the unit tests, you can use a standard regular expression. For example, to test all ModelTest
classes:
如果你想运行一组单元测试,可以使用标准的规则表达式,比如,为了测试所有的ModelTest类:
mvn test -Dtest=*ModelTest
- 使用Maven2进行单元测试
- 使用maven2 进行团队配置
- 使用maven2 进行团队配置
- 使用maven2 进行团队配置
- 使用maven2 进行团队配置
- Maven_使用maven2 进行团队配置
- 使用NUnit进行单元测试
- 使用CppUnit进行单元测试
- 使用CppUnit进行单元测试
- 使用VSTS进行单元测试
- 使用VSTS进行单元测试
- 使用EasyMock进行单元测试
- 使用VSTS进行单元测试
- 使用EUnit进行单元测试
- 使用 Spring 进行单元测试
- 使用 Spring 进行单元测试
- 使用 Spring 进行单元测试
- 使用 Spring 进行单元测试
- 关于pullup和pulldown电阻
- 工作积累之二维数组的理解
- Git使用指南
- JSP页面中嵌入flash
- Cortex-M3学习日志(一)-- GPIO实验1
- 使用Maven2进行单元测试
- 云计算的规范
- Linux驱动程序头文件
- Flume数据推送(Push)
- Lisp编程环境的搭建
- 【转】ARM 时钟的三种模式
- ARM体系结构与汇编100问(三)
- 85后大学生2800元起家创业 "捞偏门"年赚1500万
- 十五周作业1