Unitils is an open source library aimed at making unit testing easy and maintainable. Unitils builds further on existing libraries like DBUnit and EasyMock and integrates with JUnit and TestNG.
Unitils provides general asserion utilities, support for database testing, support for testing with mock objects and offers integration with Spring and Hibernate. It has been designed to offer these services to unit tests in a very configurable and loosely coupled way. As a result, services can be added and extended very easily.
Currently Unitils offers following features:
* General testing utilities
o Equality assertion through reflection, with different options like ignoring Java default/null values and ignoring order of collections
* Database testing utilities
o Automatic maintenance and constraints disabling of unit test databases
+ Support for Oracle, Hsqldb, MySql, DB2, Postgresql and Derby
o Simplify unit test database connection setup
o Simplify insertion of test data with DBUnit
o Simplify Hibernate session management for unit testing
o Automatically test the mapping of Hibernate mapped objects with the database
o Manage transactions during unit testing
* Mock object utilities
o Simplify EasyMock mock object creation
o Simplify mock object injection
o EasyMock argument matching using reflection equality
* Spring integration
o ApplicationContext configuration and easy injection of spring managed beans into a unit test
o Support for using a Spring-configured Hibernate SessionFactory in unit tests.
The project started begin 2006 from an Ordina J-Technologies discussion group on unit testing. The result was a list of guidelines and Unitils emerged in an attempt to write code to support these guidelines.
Documentation
FEST is a collection of APIs, released under the Apache 2.0 license, which mission is to simplify software testing.
Modules
FEST is composed of various modules, all of them can be used with TestNG or JUnit.
Swing Module:
* DSL-oriented API for functional Swing GUI testing
* Simulation of user-generated events and reliable GUI component lookup
* Easy-to-use and powerful API that simplifies creation and maintenance of Swing GUI functional tests:
dialog.comboBox("domain").select("Users");
dialog.textBox("username").enterText("alex.ruiz");
dialog.button("ok").click();
dialog.optionPane().requireErrorMessage()
.requireMessage("Please enter your password");
* Ability to take screenshots of failed GUI tests and embed them in a HTML test report
ztest
ztest is a small classlibrary based on java 1.5 intended to be used in junit tests.
The main purpose of ztest is to put constraints on the code structure of java programs.
It can and should be used to specify an architecure by putting constraints on class dependencies. The architecture can be reused by reusing the test.
ztest scans the bytecode of class files in directories, jars, wars, ears and computes a dependency graph. You can query this dependency graph and define the architecure by specifying valid dependencies and rejecting invalid ones.
ztest comes with a dependency-test (ZDependencyTest) with which you can define sets of classes and the allowed dependencies between them.
The class sets are defined by filtering the nodes of the dependeny graph.
ClassMock is a framework that helps the creation of unit tests for components that use reflection or annotations. In this kind of classes, the behavior is dependent of the class structure. This way, each test case usually works with a different class created specifically for the test. With ClassMock is possible to define and generate classes in runtime, allowing a better test readability and logic sharing between tests.
When using JUnit in Spring there are several features added that many developers are not aware of.
First, if you are including the Spring Context in your tests, it becomes an Integration Test, no longer a Unit Test.