{
final InvocationContextContainer icc = getInvocationContextContainer();
final OwnableReentrantLock lock = new OwnableReentrantLock(icc);
final AtomicBoolean acquired = new AtomicBoolean(false);
final AtomicBoolean threwExceptionOnRelease = new AtomicBoolean(false);
GlobalTransaction gtx = new GlobalTransaction();
gtx.setId(10);
icc.get().setGlobalTransaction(gtx);
lock.lock();
assert lock.getOwner().equals(gtx);
assert lock.getHoldCount() == 1;
Thread t = new Thread()
{
public void run()
{
try
{
GlobalTransaction gtx = new GlobalTransaction();
gtx.setId(20);
icc.get().setGlobalTransaction(gtx);
acquired.set(lock.tryLock(10, TimeUnit.MILLISECONDS));
}
catch (InterruptedException e)
{