philwebb/spring-test-dbunit — Issue #7: @ExpectedDatabase NON_STRICT tests
Author: mzagar
Created: 2012-01-23 08:17:35+00:00
State: open

Hi Phil,

Could you please take a look at ExpectedNonStrictOnClassTest and ExpectedNonStrictOnMethodTest tests?

I believe ExpectedFailureOnClassTest is missing 'assertionMode=NON_STRICT' in @ExpectedDatabase and wrong dataset XML file is used (expectedfail.xml, but should be expected_nonstrict.xml).

Also, shouldn't both those tests use DbUnitTestExecutionListener so DbUnitRunner.afterTestMethod() actually executes?
(when I put a breakpoint in DbUnitRunner.afterTestMethod() and debug the unit test, bp never hits...)

My idea for both unit tests was that entityAssert.assertValues() should pass normally, but if NON_STRICT assertion mode is not set, then dbunit should throw exception when checking against expected_nonstrict.xml dataset (since not all columns are specified in the XML file).

Am I getting something wrong here? Should I be thinking about these tests differently?

Regards,
Mario