To add in data to be tested for a table, make sure to add a Test-inititalData.xml file into your src/test/resources:
<?xml version='1.0' encoding='UTF-8'?> <dataset> <raxacore_patient_list patient_list_id="1" name="TestList1" description="First Test List" search_query="" date_created="2012-01-01 00:00:00.0" creator="1" retired="false" uuid="68547121-1b70-465d-99ee-c9dfd95e7d30"/> <raxacore_patient_list patient_list_id="2" name="TestList2" description="Second Test List" search_query="" date_created="2012-01-01 00:00:00.0" creator="1" retired="false" uuid="68547121-1b70-465e-99ee-c9dfd95e7d30"/> </dataset>
(NOTE: the src/test/resources folder should automatically come under the heading 'Other Test Resources' – if not, right click your project in Netbeans and choose Reload POM)
In addition, make sure your table mapping .hbm.xml file is defined in the test-hibernate.cfg.xml file:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "> <hibernate-configuration> <session-factory> <mapping resource="TESTTABLEMAPPINGFILE.hbm.xml" /> </session-factory> <session-factory> <mapping resource="ANOTHERMAPPINGFILE.hbm.xml" /> </session-factory> </hibernate-configuration>
(NOTE: test-hibernate.cfg.xml should also come in src/test/resources under 'Other Test Resources' – if not, create your own test-hibernate.cfg.xml)