gloeglm wrote:
What exactly do you want to test?
I don't want to test that the XML file
looks correct. If that's all I wanted, I could XmlUnit or some such mechanism.
No, I'm more interested in whether or not the *.hbm.xml files
do what I think that they do. Specifically with regard to relationships, I'm wanting to test that I setup the mapping files correctly, defining the relationships to behave as my application will expect them to behave.
Such a test would create the schema fresh (using SchemaExport), plug in some initial test data (perhaps using DbUnit), then be a client to Hibernate, ensuring that Hibernate (using my mapping files) retrieves and persists everything as expected.
I'm a bit surprised if nobody else is testing this way. The mapping files are a piece of code that makes up my system, so why wouldn't I want to test them? They're also something that I'm likely to screw up if I start tweaking with them, so I'd like a suite of test cases to tell me if I break something.