481 |
|
} |
482 |
|
|
483 |
|
/** |
484 |
+ |
* hasWaiters throws NPE if null |
485 |
+ |
*/ |
486 |
+ |
public void testHasWaitersNPE() { |
487 |
+ |
final ReentrantLock lock = new ReentrantLock(); |
488 |
+ |
try { |
489 |
+ |
lock.hasWaiters(null); |
490 |
+ |
shouldThrow(); |
491 |
+ |
} catch (NullPointerException success) { |
492 |
+ |
} catch (Exception ex) { |
493 |
+ |
unexpectedException(); |
494 |
+ |
} |
495 |
+ |
} |
496 |
+ |
|
497 |
+ |
/** |
498 |
+ |
* getWaitQueueLength throws NPE if null |
499 |
+ |
*/ |
500 |
+ |
public void testGetWaitQueueLengthNPE() { |
501 |
+ |
final ReentrantLock lock = new ReentrantLock(); |
502 |
+ |
try { |
503 |
+ |
lock.getWaitQueueLength(null); |
504 |
+ |
shouldThrow(); |
505 |
+ |
} catch (NullPointerException success) { |
506 |
+ |
} catch (Exception ex) { |
507 |
+ |
unexpectedException(); |
508 |
+ |
} |
509 |
+ |
} |
510 |
+ |
|
511 |
+ |
|
512 |
+ |
/** |
513 |
+ |
* getWaitingThreads throws NPE if null |
514 |
+ |
*/ |
515 |
+ |
public void testGetWaitingThreadsNPE() { |
516 |
+ |
final PublicReentrantLock lock = new PublicReentrantLock(); |
517 |
+ |
try { |
518 |
+ |
lock.getWaitingThreads(null); |
519 |
+ |
shouldThrow(); |
520 |
+ |
} catch (NullPointerException success) { |
521 |
+ |
} catch (Exception ex) { |
522 |
+ |
unexpectedException(); |
523 |
+ |
} |
524 |
+ |
} |
525 |
+ |
|
526 |
+ |
|
527 |
+ |
/** |
528 |
|
* hasWaiters throws IAE if not owned |
529 |
|
*/ |
530 |
|
public void testHasWaitersIAE() { |