The philosophy of DbSetup is that DAO tests should not have to setup the database, execute tests, and then remove everything from the database. Instead, a single setup method should be used to delete everything from the database (whatever the previous test put in it, or the initial state of the database tables), and then populate it with the data necessary to execute the test.
Another design choice of DbSetup is to provide an easy to use and simple Java API to populate the database, rather than loading data from external XML files. Using a Java API has several advantages:
DbSetup class and the
are the main entry points to the API that an automated test will use. Look at their javadoc below for example usage.