Closed patrickh1 closed 8 years ago
This is a feature request to be made for DBUnit framework, but the fastest way to achieve the behavior you desire would be by overriding org.dbunit.dataset.datatype.StringDataType in your test codebase
I agree with @FingolfinTEK that this should be a core DBUnit feature. I don't have that much time for this project so I'd rather keep the scope limited to just exposing standard DBUnit features.
It would be really useful if you could use wildcards or regular expressions when testing the content of columns in the expected database fields.
For example I am testing a stored procedure that does validation. If the validation fails then a message is written to the validationMessage column of the table that is being validated. These messages change constantly and it is a pain to update all of the expected data sets to reflect the changes. It would be enough for me to test if the message contained the text 'warning' or 'error'.
I have tried values such as 'warning' and '^.warning.$' but they are just compared literally.
It would also be really useful if you could test that a column was non-empty. This could be easily accomplished with regular expressions.