Is there any way to make DBUnit "Delete All" for all tables before inserting the required rows

(Newbie DBUnit question Alert!)

It looks like DBUnit for each table "removes all records from the table and performs an insert operation".

This means that you cannot use the load order of the xml file to clean up the data, as any holding record will be deleted and recreated before the records are deleted from other tables (I hope this makes sense!).

If the system "deleted everything" from all tables in the xml in order (reverse or otherwise), this problem will not exist.

So, is there a way to do it like this?

I am using MS SQL with InsertIdentityOperation (DatabaseOperation.CLEAN_INSERT).



source to share

1 answer

Inherited DBTest and added removal of the entire setup step to run normal procedure.

Clean_Insert then becomes "automatically Delete_all" + "Insert into getSetUpOperation".



All Articles