spring - Does DBUnit change the actual state of the database? -
for example, after setup datasource actual database , use @databasesetup set state, of following happens?
1) dbunit connect actual database, delete everything, insert records specified in @databasesetup, test cases , roll back.
2) dbunit somehow create in-memory database based on datasource, setup in-memory database. nothing changed in actual database.
3) magic.
how dbunit work? thanks.
dbunit ask do. if connect real database, yes, acting on real database. if tell act on in-memory database, that's do.
if clean_insert, wipe of data in tables specified in dataset you're asking load, it'll load dataset, remove loaded dataset. data wiped @ start not put in place.
if you're using dbunit testing, not point @ real (i.e. production) database. instead you'd create copy of sort , point @ that. copy real instance of db, in-memory, populated dummy data or copy of real data.
Comments
Post a Comment