@Test public void whenFound() { GammaTxnLong ref = new GammaTxnLong(stm); GammaTxn tx = newTransaction(); Tranlocal tranlocal = ref.openForRead(tx, LOCKMODE_NONE); Tranlocal found = tx.locate(ref); assertSame(tranlocal, found); assertIsActive(tx); }
@Test public void whenNotFound() { GammaTxnLong ref = new GammaTxnLong(stm); GammaTxnLong otherRef = new GammaTxnLong(stm); GammaTxn tx = newTransaction(); ref.openForRead(tx, LOCKMODE_NONE); Tranlocal found = tx.locate(otherRef); assertNull(found); assertIsActive(tx); }