I have recently started using test-driven development and unit testing, and it has paid off immensely in the areas where I have aplied it. One area that it has been helpful in is database access. When I abstract away the data access, the testing of methods that need the data become almost ridiculously easy.
However, I haven't been able to find or figure out a way to test the DAOs themselves. (It would be self-defeating to abstract them out!) A DAO should in theory just move data back and forth between the database and the application; can this be considered too simple to test?
I have experimented with setting up a Derby database on my local machine for tests, but it's difficult to automate starting the server, creating the databases, and creating the tables.
Is there any way to automate testing of data access objects?