UNITILS 测试框架
来源:互联网 发布:mastercam三维编程 编辑:程序博客网 时间:2024/04/24 13:53
Unitils(http://www.unitils.org/summary.html)这个Java开源类包的目的是让单元测试变得更加容易和可维护。Unitils构建在DBUnit与EasyMock项目之上并与JUnit和TestNG相结合。支持数据库测试,支持利用mock对象进行测试并提供与Spring和Hibernate相集成。Unitils设计成以一种高度可配置和松散偶合的方式来添加这些服务到单元测试中。
在进行数据库测试时能够:
在利用Mock对象进行测试时能够:
在与Spring集成时易于把spring管理的bean注入到单元测试中,支持在单元测试中使用一个用Spring配置的Hibernate SessionFactory。
功能点:
反射断言 (Reflection assert)
- Equality assertion through reflection
- Possibility to ignore order of collections and Java default/null values
MOCK模块(Mock module) - Makes mocking easy and maintainable
- Simple syntax for defining and asserting invoked behavior
- Gives you the best possible feedback so you can easily find out why a test is failing
- Argument matchers, partial mocking, stubbing behavior, dummy objects...
注入模块(Inject module) -Easily inject test artifacts into classes and instances
- Inject values by type and name
- Inject into static fields, e.g. singletons, and automatically reset the old value after the test
IO模块(IO module) - Support for performing IO in tests
- Creating temporary files and directories
- Loading the contents of files into objects
数据库测试(Database testing) -Support for testing with databases and loading of DbUnit data sets
- Simplify test database connection setup
- Support for setting up a separate schema/database per developer
- Transactional testing
- Easy loading of data sets
- Multi-schema data sets
- Expected data set assertions
数据库维护自动测试 (Automatic test database maintenance) -Use DbMaintain to automatically bring your unit test databases up to date before running your tests
- Automatic maintenance of databases with support for incremental, repeatable and post processing scripts
- Automatically disable constraints and set sequences to a minimum value
- Generating an XSD of the database structure for dataset xml files
Hibernate模块(Hibernate module) -Support for Hibernate database testing
- Hibernate SessionFactory creation and session management
- Automatically test the mapping of JPA entities / hibernate mapped objects with the database
Spring模块(Spring module) -Support for testing when your project uses Spring
- ApplicationContext configuration and easy injection of spring managed beans into a unit test
- Support for using a Spring-configured Hibernate SessionFactory in unit tests.
EasyMock模块(EasyMock module) -Helps you set up tests that use EasyMock as a mocking framework
- Simplify EasyMock mock object creation
- EasyMock argument matching using reflection equality
- UNITILS 测试框架
- unitils 测试框架介绍(一)
- unitils 测试框架介绍(二)
- 单元测试之测试整合框架Unitils
- Maven整合Junit unitils测试框架 cannot retrieve JUnit method
- 16.2 测试之unitils
- unitils学习2一使用Unitils测试DAO层
- unitils学习3一使用unitils测试Service层
- springMVC4(6)Unitils断言与整合测试
- 单元测试系列之4:使用Unitils测试DAO层
- 单元测试系列之4:使用Unitils测试DAO层
- 单元测试系列之3:测试整合之王Unitils
- 单元测试系列之3:测试整合之王Unitils
- 单元测试系列之4:使用Unitils测试DAO层
- 单元测试系列之5:使用unitils测试Service层
- 测试整合之王Unitils(单元测试系列)
- Unitils配置文件(Unitils介绍四)
- 用Unitils测试DAO时出现Write operations are not allowed in read-only mode异常
- PHP之静态HTML
- Oracle Procedure 存储过程
- UVA - 10025 :The ? 1 ? 2 ? ... ? n = k problem
- php imagettftext 规定宽度内自动换行
- ExpandableListView中不同条目的位置不同的显示位置
- UNITILS 测试框架
- jQuery常用方法一览
- 开发人员眼中最好的代码编辑器是谁?
- 新建android项目gen目录下未生成R文件解决方案
- iOS开发经验总结
- Android中为通知栏添加滚动条
- com.microsoft.sqlserver.jdbc.SQLServerException: 到主机 的 TCP/IP 连接失败
- java反射详解
- 【动态规划】可接受数列