IMO directly inspecting the database for ejb unit tests is flawed for so many reasons I hardly know where to start.

For starters it is simply not my job during UNIT tests to test that the container and database work - I want to test my code. Therefore if I want to know if I made the right calls to store some data in a bean then surely I test it by using the beans api to read the data back. In fact by doing this I am decoupling my tests from the CMP/CMR mapping strategy. It also means I dont have to understand in precise detail the mapping strategy used in order to write tests.

In short my unit tests test that Ive used the J2ee APIs and descriptors correctly to achieve the right end result -the correct functioning of my beans, rather than testing that the API implementations work in the way that I *think* they should.

Paul C.