alvarorodriguezmoroy wrote:
I want generate unit test for my generated entities (entity per table).
Especially I would like to check that all fields of an entity remain in the database.
Ok, and I don't see how tests that is generated at the same time as you reverse engineer would
test anything related to that since the code is generated based on the columns being there.
If you want to test that the mapping has all fields, then using something like schemavalidator (built-in to hibernate) would be an better option.
btw. if we wanted to generate test code for the entities to persist them through hibernate then we
would need to know what kind of data goes into them and generate a sane object model - to do that requires
some (heavy duty) magic.
In case your object model is super trivial (i.e. no relationships) some of this is trivial to generate but then
again what is the value of those beyond what schemavalidator can do ? If you do find value for that then
you can simply create some custom templates to use with your metamodel to generate the testing you think
make sense.