0

I have a test class that extends AbstractTransactionalDataSourceSpringContextTests.

I did not write this class, and need to make a small change. I'd like to see what would happen if i prevented the recreation of the test database (using DbUnit) after each test.

I have tried playing with the following lines:

@Override
protected void onSetUpBeforeTransaction() throws Exception {
    initialisingTables.create("Init");
}

@Override
protected void onTearDownAfterTransaction() throws Exception {
    deleteTables(true);
    deleteTables(false);
}

But nothing seems to help.

Dominic Bou-Samra
  • 14,799
  • 26
  • 100
  • 156

1 Answers1

0

I guess you just have to annotate your test methods with

@Rollback(false)

or the test class with sometjing like this:

@TransactionConfiguration(transactionManager="txMgr", defaultRollback=false)

See: 10.3.3. JDBC Testing Support

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588