Eric Lefevre-Ardant on Java & Agile

April 2, 2008

Merging lists in a Spring configuration file

Filed under: spring — Eric Lefevre-Ardant @ 10:09 am

Spring provides useful types for creating lists of values. However, it is not as good for merging lists. Here is an option.

(more…)

September 6, 2007

Unitils: a better Gienah?

Filed under: hibernate, java, spring, test — Eric Lefevre-Ardant @ 11:59 am

On my current project, I am using Gienah as a way to integrate JUnit tests with Spring. I am rather pleased with the result, keeping my unit tests quite clean.

I just heard today about Unitils, a more ambitious tool. In addition to Spring, it supports TestNG, DbUnit, EasyMock, and Hibernate (ie. almost all that we are using here!). It also provides a number of additional services, such as helper asserts.

Especially intriguing are two things:

  • they recommend temporarily removing some db constraints, and provide help to do so (”To keep database tests maintainable, test data files have to be as small as possible. (Referential) constraints however don’t help you to achieve this. We advise to disable all foreign key and not null constraints. Doing so makes it possible to specify only the data that matters for your test.“)
  • they handle database versions is a way very similar to Ruby on Rails (”The database maintainer monitors a directory on the filesystem that contains DDL scripts for creating the structure of the database. The name of these scripts should comply with following naming convention: <version>_<some name>.sql. For example: 001_create_person_table.sql, 002_create_car_table.sql“)

See here for details.

April 23, 2007

How to run XFire 1.x with Spring 2.x and Maven 2.x

Filed under: java, maven, spring, webservices, xfire — Eric Lefevre-Ardant @ 5:13 pm

In version 1.2.5 of XFire, a module called xfire-spring is necessary to run it together with , well, Spring. The issue is that the POM file for it is designed to run with Spring 1.2.x.

(more…)

March 14, 2007

Gienah: inject Spring dependencies in your JUnit 4 tests

Filed under: java, spring, test — Eric Lefevre-Ardant @ 3:08 pm

I wanted a way of using my test with dependencies coming from my Spring definition.
(more…)

Powered by WordPress