FIX: possible resource leaking in testcases (all created transactions are closed by followed try statement) (#1273)

This commit is contained in:
Roland Praml
2018-02-26 08:40:53 +13:00
committed by Rob Bygrave
parent 8e9843ab8a
commit e3425a8850
23 changed files with 278 additions and 265 deletions
@@ -82,10 +82,10 @@ public class TestBatchOnCascadeExceptionHandling extends BaseTestCase {
protected void testBatchOnCascadeIsExceptionSafe(EbeanServer server, Runnable failingOperation) {
Transaction txn = server.beginTransaction();
assertThat(txn.getBatch()).isSameAs(PersistBatch.NONE);
assertThat(txn.getBatchOnCascade()).isSameAs(PersistBatch.ALL);
try {
assertThat(txn.getBatch()).isSameAs(PersistBatch.NONE);
assertThat(txn.getBatchOnCascade()).isSameAs(PersistBatch.ALL);
failingOperation.run();
Assertions.fail("PersistenceException expected");
} catch (PersistenceException e) {