springtestdbunit / spring-test-dbunit

Integration between the Spring testing framework and DBUnit
http://springtestdbunit.github.com/spring-test-dbunit/
Apache License 2.0
475 stars 238 forks source link

Custom DatabaseAssertionMode for trimming spaces #81

Closed sandeep-chekuri closed 8 years ago

sandeep-chekuri commented 9 years ago

We have mostly char columns in the table. When the dbunit compares the data it compares with padding spaces and we end up writing a expected dataset with spaces. We have exactly same issue as defined below. http://sourceforge.net/p/dbunit/mailman/dbunit-developer/thread/200806290220.m5T2KAPO021200@49zxpd1.ch3.sourceforge.com/

Solution 1) Provide an flag in ExpectedDatabase which trims the data on actual before comparison Solution 2) Adding new DatabaseAssertionMode custom, which allows us to inject our custom DatabaseAssertion

Can you please let us know if any of the solutions are feasible

philwebb commented 8 years ago

I'm not keen on the flag, but a new DatabaseAssertionMode doesn't sound too bad. Feel free to submit a pull-request if you have time.