[Unitils]初识Unitils

简介:
http://www.unitils.org/summary.html#  
Summary  

Unitils is an open source library aimed at making unit and integration testing easy and maintainable.  

It is divided into several modules, each of them providing extra support for a certain aspect of your unit and integration tests. If you for example need mocking for your tests, just include unitils-mock as a dependency. If you would also want to load DbUnit data sets, just include unitils-dbunit.  

Below you can find a list of the modules and their features. Click on the title to go to the corresponding tutorial and examples.  

Features  

Reflection assert  

Equality assertion through reflection  
Possibility to ignore order of collections and Java default/null values  
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 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 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 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 module - Helps you set up tests that use EasyMock as a mocking framework  

Simplify EasyMock mock object creation  
EasyMock argument matching using reflection equality
目录
相关文章
|
存储 关系型数据库 MySQL
ElasticSearch第一讲:ElasticSearch从入门到精通(下)
ElasticSearch第一讲:ElasticSearch从入门到精通(下)
236 0
|
Java Spring
springboot 怎么优雅下线
在Spring Boot应用中,如果需要优雅地下线(即在应用关闭前完成一些操作,例如释放资源、保存数据等),可以使用SpringApplication.addListeners()方法来添加监听器,并在监听器中实现下线逻辑。例如:
681 1
springboot 怎么优雅下线
|
Java 编译器 Spring
面试突击78:@Autowired 和 @Resource 有什么区别?
面试突击78:@Autowired 和 @Resource 有什么区别?
6586 4
|
存储 SQL 缓存
【阿里巴巴Java编程规范学习 五】MySQL数据库规约
【阿里巴巴Java编程规范学习 五】MySQL数据库规约
1743 1
|
关系型数据库 MySQL 大数据
|
关系型数据库 Java 测试技术
Unitils集成DBUnit、Spring-单元测试
  Unitils集成DBUnit、Spring-单元测试   1、maven-pom文件中引入相关jar包   org.unitils unitils-dbunit 3.
1357 0
|
2天前
|
人工智能 自动驾驶 大数据
预告 | 阿里云邀您参加2024中国生成式AI大会上海站,马上报名
大会以“智能跃进 创造无限”为主题,设置主会场峰会、分会场研讨会及展览区,聚焦大模型、AI Infra等热点议题。阿里云智算集群产品解决方案负责人丛培岩将出席并发表《高性能智算集群设计思考与实践》主题演讲。观众报名现已开放。
|
18天前
|
存储 人工智能 弹性计算
阿里云弹性计算_加速计算专场精华概览 | 2024云栖大会回顾
2024年9月19-21日,2024云栖大会在杭州云栖小镇举行,阿里云智能集团资深技术专家、异构计算产品技术负责人王超等多位产品、技术专家,共同带来了题为《AI Infra的前沿技术与应用实践》的专场session。本次专场重点介绍了阿里云AI Infra 产品架构与技术能力,及用户如何使用阿里云灵骏产品进行AI大模型开发、训练和应用。围绕当下大模型训练和推理的技术难点,专家们分享了如何在阿里云上实现稳定、高效、经济的大模型训练,并通过多个客户案例展示了云上大模型训练的显著优势。
|
22天前
|
存储 人工智能 调度
阿里云吴结生:高性能计算持续创新,响应数据+AI时代的多元化负载需求
在数字化转型的大潮中,每家公司都在积极探索如何利用数据驱动业务增长,而AI技术的快速发展更是加速了这一进程。