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

@DatabaseTearDown doesn't work when @ExpectedDatabase fails. #49

Closed faisalferoz closed 10 years ago

faisalferoz commented 10 years ago

I have the following setup:

@DatabaseTearDown("/resetDB.xml")
public class CSVConfigTests {

    @Test
    @ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "dataVerificationTest.xml")
    public void shouldImportCSV() throws Exception {
        // db imports
    }
}

when shouldImportCSV fails due to @ExpectedDatabase assertion, @DatabaseTearDown doesn't work as data still remains in database. Is this by design or a bug?

Failure of tearDown causes other tests to fail as well.

philwebb commented 10 years ago

I think it's a bug. Could you try building the latest master and using it with your test if you get a chance?