Closed manikantag closed 8 years ago
The design of DataSetLoader
originally assumed that it would only be used to support a different dataset format. I've not seen dbunit-datasetbuilder
before and it never occurred to me that someone might want to work this way.
It should be pretty easy to make the @DatabaseSetup.value()
optional and add a new loader()
attribute.
If you have time to put together a pull-request that would be very helpful.
@manikantag I made a PR a few month ago, still waiting for feedback on it : https://github.com/springtestdbunit/spring-test-dbunit/pull/72
PR #72 has now been merged to master
HI, I m trying to create
IDataSet
programatically instead of xml datasets. For that I m using https://github.com/opensource21/dbunit-datasetbuilder (or https://github.com/marcphilipp/dbunit-datasetbuilder). How ever, the assertion fails.Below is the code:
As my dataset comes from the
LaunguageDataSetLoader
class, I wanted to NOT to give any dataset.xml path to@DatabaseSetup
. But this annotation mandates something forvalue
. When I've given empty string, like@DatabaseSetup("")
, it is giving me other exceptions.To work around this, I m giving
dummydata.xml
like below:If I leave the
@DatabaseSetup
annotation, I m gettingjunit.framework.ComparisonFailure: row count (table=language) expected:<[1]> but was:<[0]>
failure. I think this is expected only.Basically, my objective is to provide dataset from with in the class (this will avoid the need for ReplacementDataSet for currenttime or null, ...).
My question is, can we not make the
value
of the annotation optional, and also why is the annotation is supported at class level. Even better, havingdataSetLoader
support at@DatabaseSetup
level itself instead of@DbUnitConfiguration
.