September 29, 2005
Embedded Firebird and the new Spring testing classes
I have moved all of my Spring Dao tests from a roll your own test framework to one that is based on spring's
AbstractTransactionalDataSourceSpringContextTests
(a classname that is just too damn long and I will never remember). These tests (and some others) are in the spring-mocks package. Really nice except for a few issues I am learning to deal with (mostly the fact that transactions are never committed unless you force the issue). No problem with the sanity tests, so I decided to try the authorizationDao from some classes that are getting major refactoring).
This dao needs a lot of data to be in the database (this is the project that is going to use ruby on rails to fill the database). I (like most people) have used dbunit to put this data in. Part of setup. Well, setup and onSetup are final for this test - so I moved the dbunit setup (which had been in a static initializer) to onSetUpBeforeTransaction. All of a sudden my tests were not failing - they were going into some weird state and I had to kill eclipse in order to close the database. But, as soon as I moved the database to local (from embedded) everything went just fine.
I think that we had deadlock on the embedded firebird. My cure for this now (other than giving up on the spring class and rolling my own which would happily use dbunit) is to stop using embedded firebird and call through local. I still might roll my own, but it depends a lot on what else has to be done in the next two weeks.
Posted by liz at 01:36 PM | Comments (0) | TrackBack