ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ReentrantLockTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ReentrantLockTest.java (file contents):
Revision 1.13 by dl, Sun Dec 28 21:56:18 2003 UTC vs.
Revision 1.14 by dl, Sun Dec 28 22:44:59 2003 UTC

# Line 481 | Line 481 | public class ReentrantLockTest extends J
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() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines