I am writing integration test for my repository layer that use JPA. However after each test it leaves the database with a lot of rubbish that I want to get rid off when the test is over. I was looking at DBUnit which seems to be able to re-initialize my database. However the thing with extending TestCases seems a little old? I am not able to find any good tutorials explaining how to use it. I am using JUnit 4.10. Are there other frameworks that is better?
I am writing integration test for my repository layer that use JPA. However after
Share
DbUnit can be used with JUnit 4, without extending any DbUnit base class. See http://dbunit.sourceforge.net/howto.html#noextend for how to do it.
That said, I really dislike XML and like fast tests, so I wrote DbSetup to achive similar functionality, with an all-Java solution.