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) { // expected } }
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) { // expected } }
public void testNullMonitorInGuardConstructorThrowsNPE() { try { new FlagGuard(null); fail("expected NullPointerException"); } catch (NullPointerException e) { // expected } }
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 expected) { } }
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 expected) { } }
public void testNullMonitorInGuardConstructorThrowsNPE() { try { new FlagGuard(null); fail("expected NullPointerException"); } catch (NullPointerException expected) { } }