This first tutorial gets your feet wet setting up a persistent unit, creating in-memory entities and persisting those entities to a database. We let the environment create our database schema based on meta-information (annotations) in our entity classes.
This article demonstrates a brand new open source library for unit testing, called Unitils. Unitils helps you in writing simple and maintainable unit tests with JUnit or TestNG . It glues together some widely used test libraries like DbUnit and EasyMock and offers integration with Spring and Hibernate . Unitils encourages applying good practices and unit testing guidelines. The ideas behind the code are based on the authors' concrete experience on enterprise projects.
Unitils offers following features
* Equality assertion through reflection, with options like ignoring Java default/null values and ignoring order of collections
* Support for database testing involving test data management with DbUnit, automatic maintenance of unit test databases and automatic constraints disabling
* Hibernate integration features such as session management and testing the mapping with the database
* Integration with Spring, involving ApplicationContext management and injection of spring managed beans
* Integration with EasyMock and injection of mocks into other objects
Joda-Time provides a complete quality alternative to the JDK date and time classes. At some point however, many projects need to persist these classes to a database. One popular tool for achieving this is Hibernate.
To ease the integration of Joda-Time and Hibernate, this sub-project was setup. It aims to provide the classes necessary to persist Joda-Time objects.