Search in sources :

Example 6 with OptimisticLock

use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.

the class OptimisticLockTest method testAcquireAndRelease.

@Test
public void testAcquireAndRelease() {
    OptimisticLock l = new OptimisticLock();
    l.acquire();
    l.release();
    assertFalse(l.isAcquired());
    assertTrue(l.isReleased());
}
Also used : OptimisticLock(org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock) Test(org.junit.Test)

Example 7 with OptimisticLock

use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.

the class OptimisticLockTest method testMultipleAcquires.

@Test
public void testMultipleAcquires() {
    OptimisticLock l = new OptimisticLock();
    l.acquire();
    l.acquire();
    l.release();
    assertTrue(l.isAcquired());
    assertFalse(l.isReleased());
}
Also used : OptimisticLock(org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock) Test(org.junit.Test)

Aggregations

OptimisticLock (org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock)7 Test (org.junit.Test)5 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)1 SequenceBoxGrid (org.eclipse.scout.rt.client.ui.form.fields.sequencebox.internal.SequenceBoxGrid)1