assertNotNull("Tx should have been set up by now", cache.getInvocationContext().getTransaction());
assertEquals("The same current transaction should be associated with this invocation ctx.", tm.getTransaction(), cache.getInvocationContext().getTransaction());
assertNotNull("Gtx should have been set up by now", cache.getInvocationContext().getGlobalTransaction());
Transaction tx = tm.getTransaction();
TransactionEntry entry = tt.get(tt.get(tx));
if (commit)
{
tm.commit();
}
else
{
tm.rollback();
}
assertNull("Tx should have been scrubbed", cache.getInvocationContext().getTransaction());
assertNull("Gtx should have been scrubbed", cache.getInvocationContext().getGlobalTransaction());
assertEquals("MethodCall should have been scrubbed", null, cache.getInvocationContext().getMethodCall());
// check that the transaction entry hasn't leaked stuff.
assert entry.getModifications().isEmpty() : "Should have scrubbed modifications in transaction entry";
assert entry.getCacheLoaderModifications().isEmpty() : "Should have scrubbed modifications in transaction entry";
assert entry.getOrderedSynchronizationHandler() == null : "Should have removed the ordered sync handler";
}