Hi snichele,
I always wanted to add such functionallity (or similar) to the tools, but just haven't had the free cycles to do it.
Note, there are more than one way to skin a cat or validate hbm's and one of them is the new SchemaValidator in hibernate3 which validates some of the mappings between a hbm and an existing database.
SchemaValidator is a component in what I one day would like to have and call hbmlint (
http://opensource2.atlassian.com/projec ... wse/HBX-95)
Another part of testing is (more or less random) data generation which datagen should do (
http://opensource2.atlassian.com/projec ... se/HBX-215 and
http://opensource2.atlassian.com/projec ... se/HBX-276)
And finally the issue you are talking about generation of basic junit test - again these can be fully automated or simply just a generation of a skeletion the developer can customize/extend for his or her needs.
This can be at different levels DAO, POJO, View etc., but I think to begin with just generating a few basic Pojo tests that validates that what one is doing with actual real code (instead of dynamic tests as the hbmlint) will be a good thing as it is more tangible and does not require a second layer.
As always contributions are welcome and the toolset is very extendible - just write a pojotest.vm and use <hbmtemplate template="pojotest.vm" filepattern="{package-name}/{class-name}HibernateTest.java"/> and you are "almost" there ;)