286 |
|
} |
287 |
|
|
288 |
|
/** |
289 |
< |
* hasQueuedThread reports whether a thread is queued. |
289 |
> |
* hasQueuedThread reports whether a thread is queued |
290 |
|
*/ |
291 |
|
public void testHasQueuedThread() { testHasQueuedThread(false); } |
292 |
|
public void testHasQueuedThread_fair() { testHasQueuedThread(true); } |
347 |
|
} |
348 |
|
|
349 |
|
/** |
350 |
< |
* timed tryLock is interruptible. |
350 |
> |
* timed tryLock is interruptible |
351 |
|
*/ |
352 |
|
public void testTryLock_Interruptible() { testTryLock_Interruptible(false); } |
353 |
|
public void testTryLock_Interruptible_fair() { testTryLock_Interruptible(true); } |
985 |
|
} |
986 |
|
|
987 |
|
/** |
988 |
< |
* signal wakes up waiting threads in FIFO order. |
988 |
> |
* signal wakes up waiting threads in FIFO order |
989 |
|
*/ |
990 |
|
public void testSignalWakesFifo() { testSignalWakesFifo(false); } |
991 |
|
public void testSignalWakesFifo_fair() { testSignalWakesFifo(true); } |
1110 |
|
public void testToString_fair() { testToString(true); } |
1111 |
|
public void testToString(boolean fair) { |
1112 |
|
ReentrantLock lock = new ReentrantLock(fair); |
1113 |
< |
String us = lock.toString(); |
1114 |
< |
assertTrue(us.indexOf("Unlocked") >= 0); |
1113 |
> |
assertTrue(lock.toString().contains("Unlocked")); |
1114 |
|
lock.lock(); |
1115 |
< |
String ls = lock.toString(); |
1116 |
< |
assertTrue(ls.indexOf("Locked") >= 0); |
1115 |
> |
assertTrue(lock.toString().contains("Locked")); |
1116 |
> |
lock.unlock(); |
1117 |
> |
assertTrue(lock.toString().contains("Unlocked")); |
1118 |
|
} |
1119 |
|
} |