com.google.common.util.concurrent.GeneratedMonitorTest.FlagGuard

Here are the examples of the java api class com.google.common.util.concurrent.GeneratedMonitorTest.FlagGuard taken from open source projects.

1. SupplementalMonitorTest#testGetWaitQueueLengthWithWrongMonitorThrowsIMSE()

Project: guava
Source File: SupplementalMonitorTest.java
View license
public void testGetWaitQueueLengthWithWrongMonitorThrowsIMSE() {
    Monitor monitor1 = new Monitor();
    Monitor monitor2 = new Monitor();
    FlagGuard guard = new FlagGuard(monitor2);
    try {
        monitor1.getWaitQueueLength(guard);
        fail("expected IllegalMonitorStateException");
    } catch (IllegalMonitorStateException e) {
    }
}

2. SupplementalMonitorTest#testHasWaitersWithWrongMonitorThrowsIMSE()

Project: guava
Source File: SupplementalMonitorTest.java
View license
public void testHasWaitersWithWrongMonitorThrowsIMSE() {
    Monitor monitor1 = new Monitor();
    Monitor monitor2 = new Monitor();
    FlagGuard guard = new FlagGuard(monitor2);
    try {
        monitor1.hasWaiters(guard);
        fail("expected IllegalMonitorStateException");
    } catch (IllegalMonitorStateException e) {
    }
}