takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

support DatabaseSequenceFilter #46

Open davidkarlsen opened 8 years ago

davidkarlsen commented 8 years ago

It would be nice to be able to use DatabaseSequenceFilter in order to order the table actions automatically by FK refs to avoid constraint violations w/o having to order the tables manually in the datasets.

http://dbunit.sourceforge.net/faq.html#fkconstraintviolation http://dbunit.sourceforge.net/apidocs/org/dbunit/dataset/FilteredDataSet.html

davidkarlsen commented 8 years ago

@slandelle Any thoughts or implementation hints on this?

slandelle commented 8 years ago

@davidkarlsen Honestly, no idea. I'll be honest: I no longer use this project and really don't have time to do anything more than accepting contributions and dealing with releases.

davidkarlsen commented 8 years ago

@slandelle OK - nice to know - have you found better alternatives for the same functionality (e.g. integrating dbunit nicely into spring based integration tests)?

Seems like this might be the way to go: https://github.com/springtestdbunit/spring-test-dbunit

slandelle commented 8 years ago

Several things:

davidkarlsen commented 8 years ago

Definitively use the proper database - that's what we do. But being able to run small datasets per test and [mostly] be able to roll it away after the test is very nice (to the extent that integration-tests are the way to go - we favour unit-tests)

slandelle commented 8 years ago

And one last thing: I really ended up hating dbunit:

If I really was to conduct db tests this way, I'd rather use DbSetup instead.