tm.getTransaction().runCommitTx();
assertAttributeValue("NumberOfLocksHeld", 0);
}
public void testNumberOfLocksAvailable() throws Exception {
DummyTransactionManager tm = (DummyTransactionManager) TestingUtil.extractComponent(cache, TransactionManager.class);
int initialAvailable = getAttrValue("NumberOfLocksAvailable");
tm.begin();
cache.put("key", "value");
tm.getTransaction().runPrepare();
assertAttributeValue("NumberOfLocksHeld", 1);
assertAttributeValue("NumberOfLocksAvailable", initialAvailable - 1);
tm.rollback();
assertAttributeValue("NumberOfLocksAvailable", initialAvailable);
assertAttributeValue("NumberOfLocksHeld", 0);
}