IDEMPIERE-87 AdempiereTestCase must not close the transaction when committing/rolling back

http://jira.idempiere.com/browse/IDEMPIERE-87
This commit is contained in:
Carlos Ruiz 2011-10-23 09:48:44 -05:00
parent 29ed9dd002
commit 694aa1242b
1 changed files with 16 additions and 12 deletions

View File

@ -171,13 +171,8 @@ public class AdempiereTestCase extends TestCase
if (trxName != null)
trx = Trx.get(trxName, false);
if (trx != null && trx.isActive()) {
try {
trx.commit(true);
} finally {
trx.close();
}
trx.commit(true);
}
trx = null;
}
/**
@ -188,13 +183,20 @@ public class AdempiereTestCase extends TestCase
if (trxName != null)
trx = Trx.get(trxName, false);
if (trx != null && trx.isActive()) {
try {
trx.rollback();
} finally {
trx.close();
}
trx.rollback();
}
}
/**
* Close active transaction
*/
protected void close() {
Trx trx = null;
if (trxName != null)
trx = Trx.get(trxName, false);
if (trx != null) {
trx.close();
}
trx = null;
}
@Override
@ -207,6 +209,8 @@ public class AdempiereTestCase extends TestCase
trx = Trx.get(trxName, false);
if (trx != null && trx.isActive()) {
trx.rollback();
}
if (trx != null) {
trx.close();
}
trx = null;