Hi, all I meet a issue on integration unit test on Dao layer.
Before this project, we use Spring as IoC and Transaction manager, so in our Dao layer's integration unit test, the database could auto-rollback. Spring support a super class for inherit. But this time we migrate to Guice, no features like Spring's solution.
I think, we can use hsql instead of mysql for testing, so we do not need to rollback to prevent dirty data. But I need more suggestions.
Does anyone have better suggestions ? Thanks very much.
Mama always said, "Life is like a box of chocolates; you never know what you're gonna get. And then you have to get medieval on somebody's buttocks."
Thank you,Jeanne I tried DBUnit, it works well for most of times. HSQL does not work for me, because my java application persistence layer is not based on Hibernate or JPA, so my schema sql script is created for MySQL5.
DBUnit works well but I am confused with a bit.
I use UUID as Key in MySQL 5 InnoDB, and the data type is not varchar(36), it's varbinary(36). DBUnit doesn't work for this type for dataset(xml).
I am trying to solve the problem.
Joined: Jul 24, 2007
The problem is because my xml is not validated. DBUnit works very well for my database and project.