I wish to write tests for our Seam Framework-based web site's internal search engine that uses Hibernate + Lucene indexing (on DB2) for queries. What is the best solution for populating the data source before the TestNG suite is run when the project's data model is quite complex considering entity relationships and field constraints? For some test cases, at least a dozen database tables would require rows relating to each other in order to adhere to the data model's constraints. Ideally Hypersonic would be used since in-memory usage will shorten our build process' running time.
Hopefully my question is clear as it's difficult to formulate a complete picture of my problem without throwing up a massive wall of descriptive text and proprietary code. Basically, creating each entity programmatically (instantiating all objects via Hibernate's Home object, setting each property, persisting to data source, and committing transaction in a FacesRequest @Test) is too unwieldy given the data model and the populate.sql script we already have written (and is executed on DB2 for running our JBoss-hosted web site locally) can't be used on Hypersonic! And every TestNG example I come across online or in books contain brutally simple data sets that don't indicate a clear approach to my problem.