We are in the process of analyzing DBUnit for data driven unit testing. We were able to export oracle DB tables to a flat xml dataset using the code below and use the generated dataset as an input to our junit testing.
// partial database export
QueryDataSet partialDataSet = new QueryDataSet(connection);
partialDataSet.addTable("FOO", "SELECT * FROM TABLE WHERE COL='VALUE'");
partialDataSet.addTable("BAR");
FlatXmlDataSet.write(partialDataSet, new FileOutputStream("partial.xml"));
org.dbunit.database.QueryDataSet provides option to add tables but not Sequences. We need to export the sequence also the same way to DBUnit Dataset. Is there a way to achieve this ?
We are looking for tools for unit testing (data driven) the Repository layer using open source tools. Is there any other open source tool similar to DBUnit ?