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

Comparing jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java (file contents):
Revision 1.12 by dl, Fri Jan 9 14:45:58 2004 UTC vs.
Revision 1.15 by dl, Sat Jan 10 20:37:20 2004 UTC

# Line 46 | Line 46 | public class AbstractQueuedSynchronizerT
46              if (getState() == 0) throw new IllegalMonitorStateException();
47          }
48          
49 <        public ConditionObject newCondition() { return new ConditionObject(); }
49 >        public AbstractQueuedSynchronizer.ConditionObject newCondition() { return new AbstractQueuedSynchronizer.ConditionObject(); }
50          
51          public void lock() {
52              acquireExclusiveUninterruptibly(1);
# Line 254 | Line 254 | public class AbstractQueuedSynchronizerT
254      }
255  
256      /**
257 <     * timed tryAcquireExclusive is interruptible.
257 >     * acquireExclusiveNanos is interruptible.
258       */
259      public void testInterruptedException2() {
260          final Mutex lock = new Mutex();
# Line 297 | Line 297 | public class AbstractQueuedSynchronizerT
297      }
298  
299      /**
300 <     * acquireExclusiveTimed on a locked lock times out
300 >     * acquireExclusiveNanos on a locked lock times out
301       */
302 <    public void testacquireExclusiveTimed_Timeout() {
302 >    public void testAcquireExclusiveNanos_Timeout() {
303          final Mutex lock = new Mutex();
304          lock.acquireExclusiveUninterruptibly(1);
305          Thread t = new Thread(new Runnable() {
# Line 322 | Line 322 | public class AbstractQueuedSynchronizerT
322      
323    
324      /**
325 <     * isLocked is true when locked and false when not
325 >     * getState is true when acquired and false when not
326       */
327 <    public void testIsLocked() {
327 >    public void testGetState() {
328          final Mutex lock = new Mutex();
329          lock.acquireExclusiveUninterruptibly(1);
330          assertTrue(lock.isLocked());
# Line 408 | Line 408 | public class AbstractQueuedSynchronizerT
408       */
409      public void testAwait_IllegalMonitor() {
410          final Mutex lock = new Mutex();
411 <        final Condition c = lock.newCondition();
411 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
412          try {
413              c.await();
414              shouldThrow();
# Line 425 | Line 425 | public class AbstractQueuedSynchronizerT
425       */
426      public void testSignal_IllegalMonitor() {
427          final Mutex lock = new Mutex();
428 <        final Condition c = lock.newCondition();
428 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
429          try {
430              c.signal();
431              shouldThrow();
# Line 442 | Line 442 | public class AbstractQueuedSynchronizerT
442       */
443      public void testAwaitNanos_Timeout() {
444          final Mutex lock = new Mutex();
445 <        final Condition c = lock.newCondition();
445 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
446          try {
447              lock.acquireExclusiveUninterruptibly(1);
448              long t = c.awaitNanos(100);
# Line 459 | Line 459 | public class AbstractQueuedSynchronizerT
459       */
460      public void testAwait_Timeout() {
461          final Mutex lock = new Mutex();
462 <        final Condition c = lock.newCondition();
462 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
463          try {
464              lock.acquireExclusiveUninterruptibly(1);
465              assertFalse(c.await(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
# Line 475 | Line 475 | public class AbstractQueuedSynchronizerT
475       */
476      public void testAwaitUntil_Timeout() {
477          final Mutex lock = new Mutex();
478 <        final Condition c = lock.newCondition();
478 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
479          try {
480              lock.acquireExclusiveUninterruptibly(1);
481              java.util.Date d = new java.util.Date();
# Line 492 | Line 492 | public class AbstractQueuedSynchronizerT
492       */
493      public void testAwait() {
494          final Mutex lock = new Mutex();
495 <        final Condition c = lock.newCondition();
495 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
496          Thread t = new Thread(new Runnable() {
497                  public void run() {
498                      try {
# Line 521 | Line 521 | public class AbstractQueuedSynchronizerT
521      }
522  
523  
524 +
525 +    /**
526 +     * hasWaiters throws NPE if null
527 +     */
528 +    public void testHasWaitersNPE() {
529 +        final Mutex lock = new Mutex();
530 +        try {
531 +            lock.hasWaiters(null);
532 +            shouldThrow();
533 +        } catch (NullPointerException success) {
534 +        } catch (Exception ex) {
535 +            unexpectedException();
536 +        }
537 +    }
538 +
539 +    /**
540 +     * getWaitQueueLength throws NPE if null
541 +     */
542 +    public void testGetWaitQueueLengthNPE() {
543 +        final Mutex lock = new Mutex();
544 +        try {
545 +            lock.getWaitQueueLength(null);
546 +            shouldThrow();
547 +        } catch (NullPointerException success) {
548 +        } catch (Exception ex) {
549 +            unexpectedException();
550 +        }
551 +    }
552 +
553 +
554 +    /**
555 +     * getWaitingThreads throws NPE if null
556 +     */
557 +    public void testGetWaitingThreadsNPE() {
558 +        final Mutex lock = new Mutex();
559 +        try {
560 +            lock.getWaitingThreads(null);
561 +            shouldThrow();
562 +        } catch (NullPointerException success) {
563 +        } catch (Exception ex) {
564 +            unexpectedException();
565 +        }
566 +    }
567 +
568 +
569 +    /**
570 +     * hasWaiters throws IAE if not owned
571 +     */
572 +    public void testHasWaitersIAE() {
573 +        final Mutex lock = new Mutex();
574 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
575 +        final Mutex lock2 = new Mutex();
576 +        try {
577 +            lock2.hasWaiters(c);
578 +            shouldThrow();
579 +        } catch (IllegalArgumentException success) {
580 +        } catch (Exception ex) {
581 +            unexpectedException();
582 +        }
583 +    }
584 +
585 +    /**
586 +     * hasWaiters throws IMSE if not locked
587 +     */
588 +    public void testHasWaitersIMSE() {
589 +        final Mutex lock = new Mutex();
590 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
591 +        try {
592 +            lock.hasWaiters(c);
593 +            shouldThrow();
594 +        } catch (IllegalMonitorStateException success) {
595 +        } catch (Exception ex) {
596 +            unexpectedException();
597 +        }
598 +    }
599 +
600 +
601 +    /**
602 +     * getWaitQueueLength throws IAE if not owned
603 +     */
604 +    public void testGetWaitQueueLengthIAE() {
605 +        final Mutex lock = new Mutex();
606 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
607 +        final Mutex lock2 = new Mutex();
608 +        try {
609 +            lock2.getWaitQueueLength(c);
610 +            shouldThrow();
611 +        } catch (IllegalArgumentException success) {
612 +        } catch (Exception ex) {
613 +            unexpectedException();
614 +        }
615 +    }
616 +
617 +    /**
618 +     * getWaitQueueLength throws IMSE if not locked
619 +     */
620 +    public void testGetWaitQueueLengthIMSE() {
621 +        final Mutex lock = new Mutex();
622 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
623 +        try {
624 +            lock.getWaitQueueLength(c);
625 +            shouldThrow();
626 +        } catch (IllegalMonitorStateException success) {
627 +        } catch (Exception ex) {
628 +            unexpectedException();
629 +        }
630 +    }
631 +
632 +
633 +    /**
634 +     * getWaitingThreads throws IAE if not owned
635 +     */
636 +    public void testGetWaitingThreadsIAE() {
637 +        final Mutex lock = new Mutex();
638 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
639 +        final Mutex lock2 = new Mutex();        
640 +        try {
641 +            lock2.getWaitingThreads(c);
642 +            shouldThrow();
643 +        } catch (IllegalArgumentException success) {
644 +        } catch (Exception ex) {
645 +            unexpectedException();
646 +        }
647 +    }
648 +
649 +    /**
650 +     * getWaitingThreads throws IMSE if not locked
651 +     */
652 +    public void testGetWaitingThreadsIMSE() {
653 +        final Mutex lock = new Mutex();
654 +        final AbstractQueuedSynchronizer.ConditionObject c = (lock.newCondition());
655 +        try {
656 +            lock.getWaitingThreads(c);
657 +            shouldThrow();
658 +        } catch (IllegalMonitorStateException success) {
659 +        } catch (Exception ex) {
660 +            unexpectedException();
661 +        }
662 +    }
663 +
664 +
665 +
666      /**
667 <     * Latch isSignalled initially returns false, then true after release
667 >     * hasWaiters returns true when a thread is waiting, else false
668       */
669 <    public void testLatchIsSignalled() {
669 >    public void testHasWaiters() {
670 >        final Mutex lock = new Mutex();
671 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
672 >        Thread t = new Thread(new Runnable() {
673 >                public void run() {
674 >                    try {
675 >                        lock.acquireExclusiveUninterruptibly(1);
676 >                        threadAssertFalse(lock.hasWaiters(c));
677 >                        threadAssertEquals(0, lock.getWaitQueueLength(c));
678 >                        c.await();
679 >                        lock.releaseExclusive(1);
680 >                    }
681 >                    catch(InterruptedException e) {
682 >                        threadUnexpectedException();
683 >                    }
684 >                }
685 >            });
686 >
687 >        try {
688 >            t.start();
689 >            Thread.sleep(SHORT_DELAY_MS);
690 >            lock.acquireExclusiveUninterruptibly(1);
691 >            assertTrue(lock.hasWaiters(c));
692 >            assertEquals(1, lock.getWaitQueueLength(c));
693 >            c.signal();
694 >            lock.releaseExclusive(1);
695 >            Thread.sleep(SHORT_DELAY_MS);
696 >            lock.acquireExclusiveUninterruptibly(1);
697 >            assertFalse(lock.hasWaiters(c));
698 >            assertEquals(0, lock.getWaitQueueLength(c));
699 >            lock.releaseExclusive(1);
700 >            t.join(SHORT_DELAY_MS);
701 >            assertFalse(t.isAlive());
702 >        }
703 >        catch (Exception ex) {
704 >            unexpectedException();
705 >        }
706 >    }
707 >
708 >    /**
709 >     * getWaitQueueLength returns number of waiting threads
710 >     */
711 >    public void testGetWaitQueueLength() {
712 >        final Mutex lock = new Mutex();
713 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
714 >        Thread t1 = new Thread(new Runnable() {
715 >                public void run() {
716 >                    try {
717 >                        lock.acquireExclusiveUninterruptibly(1);
718 >                        threadAssertFalse(lock.hasWaiters(c));
719 >                        threadAssertEquals(0, lock.getWaitQueueLength(c));
720 >                        c.await();
721 >                        lock.releaseExclusive(1);
722 >                    }
723 >                    catch(InterruptedException e) {
724 >                        threadUnexpectedException();
725 >                    }
726 >                }
727 >            });
728 >
729 >        Thread t2 = new Thread(new Runnable() {
730 >                public void run() {
731 >                    try {
732 >                        lock.acquireExclusiveUninterruptibly(1);
733 >                        threadAssertTrue(lock.hasWaiters(c));
734 >                        threadAssertEquals(1, lock.getWaitQueueLength(c));
735 >                        c.await();
736 >                        lock.releaseExclusive(1);
737 >                    }
738 >                    catch(InterruptedException e) {
739 >                        threadUnexpectedException();
740 >                    }
741 >                }
742 >            });
743 >
744 >        try {
745 >            t1.start();
746 >            Thread.sleep(SHORT_DELAY_MS);
747 >            t2.start();
748 >            Thread.sleep(SHORT_DELAY_MS);
749 >            lock.acquireExclusiveUninterruptibly(1);
750 >            assertTrue(lock.hasWaiters(c));
751 >            assertEquals(2, lock.getWaitQueueLength(c));
752 >            c.signalAll();
753 >            lock.releaseExclusive(1);
754 >            Thread.sleep(SHORT_DELAY_MS);
755 >            lock.acquireExclusiveUninterruptibly(1);
756 >            assertFalse(lock.hasWaiters(c));
757 >            assertEquals(0, lock.getWaitQueueLength(c));
758 >            lock.releaseExclusive(1);
759 >            t1.join(SHORT_DELAY_MS);
760 >            t2.join(SHORT_DELAY_MS);
761 >            assertFalse(t1.isAlive());
762 >            assertFalse(t2.isAlive());
763 >        }
764 >        catch (Exception ex) {
765 >            unexpectedException();
766 >        }
767 >    }
768 >
769 >    /**
770 >     * getWaitingThreads returns only and all waiting threads
771 >     */
772 >    public void testGetWaitingThreads() {
773 >        final Mutex lock = new Mutex();
774 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
775 >        Thread t1 = new Thread(new Runnable() {
776 >                public void run() {
777 >                    try {
778 >                        lock.acquireExclusiveUninterruptibly(1);
779 >                        threadAssertTrue(lock.getWaitingThreads(c).isEmpty());
780 >                        c.await();
781 >                        lock.releaseExclusive(1);
782 >                    }
783 >                    catch(InterruptedException e) {
784 >                        threadUnexpectedException();
785 >                    }
786 >                }
787 >            });
788 >
789 >        Thread t2 = new Thread(new Runnable() {
790 >                public void run() {
791 >                    try {
792 >                        lock.acquireExclusiveUninterruptibly(1);
793 >                        threadAssertFalse(lock.getWaitingThreads(c).isEmpty());
794 >                        c.await();
795 >                        lock.releaseExclusive(1);
796 >                    }
797 >                    catch(InterruptedException e) {
798 >                        threadUnexpectedException();
799 >                    }
800 >                }
801 >            });
802 >
803 >        try {
804 >            lock.acquireExclusiveUninterruptibly(1);
805 >            assertTrue(lock.getWaitingThreads(c).isEmpty());
806 >            lock.releaseExclusive(1);
807 >            t1.start();
808 >            Thread.sleep(SHORT_DELAY_MS);
809 >            t2.start();
810 >            Thread.sleep(SHORT_DELAY_MS);
811 >            lock.acquireExclusiveUninterruptibly(1);
812 >            assertTrue(lock.hasWaiters(c));
813 >            assertTrue(lock.getWaitingThreads(c).contains(t1));
814 >            assertTrue(lock.getWaitingThreads(c).contains(t2));
815 >            c.signalAll();
816 >            lock.releaseExclusive(1);
817 >            Thread.sleep(SHORT_DELAY_MS);
818 >            lock.acquireExclusiveUninterruptibly(1);
819 >            assertFalse(lock.hasWaiters(c));
820 >            assertTrue(lock.getWaitingThreads(c).isEmpty());
821 >            lock.releaseExclusive(1);
822 >            t1.join(SHORT_DELAY_MS);
823 >            t2.join(SHORT_DELAY_MS);
824 >            assertFalse(t1.isAlive());
825 >            assertFalse(t2.isAlive());
826 >        }
827 >        catch (Exception ex) {
828 >            unexpectedException();
829 >        }
830 >    }
831 >
832 >
833 >
834 >    /**
835 >     * awaitUninterruptibly doesn't abort on interrupt
836 >     */
837 >    public void testAwaitUninterruptibly() {
838 >        final Mutex lock = new Mutex();
839 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
840 >        Thread t = new Thread(new Runnable() {
841 >                public void run() {
842 >                    lock.acquireExclusiveUninterruptibly(1);
843 >                    c.awaitUninterruptibly();
844 >                    lock.releaseExclusive(1);
845 >                }
846 >            });
847 >
848 >        try {
849 >            t.start();
850 >            Thread.sleep(SHORT_DELAY_MS);
851 >            t.interrupt();
852 >            lock.acquireExclusiveUninterruptibly(1);
853 >            c.signal();
854 >            lock.releaseExclusive(1);
855 >            assert(t.isInterrupted());
856 >            t.join(SHORT_DELAY_MS);
857 >            assertFalse(t.isAlive());
858 >        }
859 >        catch (Exception ex) {
860 >            unexpectedException();
861 >        }
862 >    }
863 >
864 >    /**
865 >     * await is interruptible
866 >     */
867 >    public void testAwait_Interrupt() {
868 >        final Mutex lock = new Mutex();
869 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
870 >        Thread t = new Thread(new Runnable() {
871 >                public void run() {
872 >                    try {
873 >                        lock.acquireExclusiveUninterruptibly(1);
874 >                        c.await();
875 >                        lock.releaseExclusive(1);
876 >                        threadShouldThrow();
877 >                    }
878 >                    catch(InterruptedException success) {
879 >                    }
880 >                }
881 >            });
882 >
883 >        try {
884 >            t.start();
885 >            Thread.sleep(SHORT_DELAY_MS);
886 >            t.interrupt();
887 >            t.join(SHORT_DELAY_MS);
888 >            assertFalse(t.isAlive());
889 >        }
890 >        catch (Exception ex) {
891 >            unexpectedException();
892 >        }
893 >    }
894 >
895 >    /**
896 >     * awaitNanos is interruptible
897 >     */
898 >    public void testAwaitNanos_Interrupt() {
899 >        final Mutex lock = new Mutex();
900 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
901 >        Thread t = new Thread(new Runnable() {
902 >                public void run() {
903 >                    try {
904 >                        lock.acquireExclusiveUninterruptibly(1);
905 >                        c.awaitNanos(1000 * 1000 * 1000); // 1 sec
906 >                        lock.releaseExclusive(1);
907 >                        threadShouldThrow();
908 >                    }
909 >                    catch(InterruptedException success) {
910 >                    }
911 >                }
912 >            });
913 >
914 >        try {
915 >            t.start();
916 >            Thread.sleep(SHORT_DELAY_MS);
917 >            t.interrupt();
918 >            t.join(SHORT_DELAY_MS);
919 >            assertFalse(t.isAlive());
920 >        }
921 >        catch (Exception ex) {
922 >            unexpectedException();
923 >        }
924 >    }
925 >
926 >    /**
927 >     * awaitUntil is interruptible
928 >     */
929 >    public void testAwaitUntil_Interrupt() {
930 >        final Mutex lock = new Mutex();
931 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
932 >        Thread t = new Thread(new Runnable() {
933 >                public void run() {
934 >                    try {
935 >                        lock.acquireExclusiveUninterruptibly(1);
936 >                        java.util.Date d = new java.util.Date();
937 >                        c.awaitUntil(new java.util.Date(d.getTime() + 10000));
938 >                        lock.releaseExclusive(1);
939 >                        threadShouldThrow();
940 >                    }
941 >                    catch(InterruptedException success) {
942 >                    }
943 >                }
944 >            });
945 >
946 >        try {
947 >            t.start();
948 >            Thread.sleep(SHORT_DELAY_MS);
949 >            t.interrupt();
950 >            t.join(SHORT_DELAY_MS);
951 >            assertFalse(t.isAlive());
952 >        }
953 >        catch (Exception ex) {
954 >            unexpectedException();
955 >        }
956 >    }
957 >
958 >    /**
959 >     * signalAll wakes up all threads
960 >     */
961 >    public void testSignalAll() {
962 >        final Mutex lock = new Mutex();
963 >        final AbstractQueuedSynchronizer.ConditionObject c = lock.newCondition();
964 >        Thread t1 = new Thread(new Runnable() {
965 >                public void run() {
966 >                    try {
967 >                        lock.acquireExclusiveUninterruptibly(1);
968 >                        c.await();
969 >                        lock.releaseExclusive(1);
970 >                    }
971 >                    catch(InterruptedException e) {
972 >                        threadUnexpectedException();
973 >                    }
974 >                }
975 >            });
976 >
977 >        Thread t2 = new Thread(new Runnable() {
978 >                public void run() {
979 >                    try {
980 >                        lock.acquireExclusiveUninterruptibly(1);
981 >                        c.await();
982 >                        lock.releaseExclusive(1);
983 >                    }
984 >                    catch(InterruptedException e) {
985 >                        threadUnexpectedException();
986 >                    }
987 >                }
988 >            });
989 >
990 >        try {
991 >            t1.start();
992 >            t2.start();
993 >            Thread.sleep(SHORT_DELAY_MS);
994 >            lock.acquireExclusiveUninterruptibly(1);
995 >            c.signalAll();
996 >            lock.releaseExclusive(1);
997 >            t1.join(SHORT_DELAY_MS);
998 >            t2.join(SHORT_DELAY_MS);
999 >            assertFalse(t1.isAlive());
1000 >            assertFalse(t2.isAlive());
1001 >        }
1002 >        catch (Exception ex) {
1003 >            unexpectedException();
1004 >        }
1005 >    }
1006 >
1007 >
1008 >    /**
1009 >     * toString indicates current state
1010 >     */
1011 >    public void testToString() {
1012 >        Mutex lock = new Mutex();
1013 >        String us = lock.toString();
1014 >        assertTrue(us.indexOf("State = 0") >= 0);
1015 >        lock.acquireExclusiveUninterruptibly(1);
1016 >        String ls = lock.toString();
1017 >        assertTrue(ls.indexOf("State = 1") >= 0);
1018 >    }
1019 >
1020 >    /**
1021 >     * A serialized AQS deserializes with current state
1022 >     */
1023 >    public void testSerialization() {
1024 >        Mutex l = new Mutex();
1025 >        l.acquireExclusiveUninterruptibly(1);
1026 >        assertTrue(l.isLocked());
1027 >
1028 >        try {
1029 >            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
1030 >            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
1031 >            out.writeObject(l);
1032 >            out.close();
1033 >
1034 >            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
1035 >            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
1036 >            Mutex r = (Mutex) in.readObject();
1037 >            assertTrue(r.isLocked());
1038 >        } catch(Exception e){
1039 >            e.printStackTrace();
1040 >            unexpectedException();
1041 >        }
1042 >    }
1043 >
1044 >
1045 >    /**
1046 >     * tryReleaseShared setting state changes getState
1047 >     */
1048 >    public void testGetStateWithReleaseShared() {
1049          final BooleanLatch l = new BooleanLatch();
1050          assertFalse(l.isSignalled());
1051          l.releaseShared(0);
# Line 534 | Line 1055 | public class AbstractQueuedSynchronizerT
1055      /**
1056       * release and has no effect when already signalled
1057       */
1058 <    public void testLatchBoolean() {
1058 >    public void testReleaseShared() {
1059          final BooleanLatch l = new BooleanLatch();
1060          assertFalse(l.isSignalled());
1061          l.releaseShared(0);
# Line 546 | Line 1067 | public class AbstractQueuedSynchronizerT
1067      /**
1068       * acquireSharedInterruptibly returns after release, but not before
1069       */
1070 <    public void testLatchAcquireSharedInterruptibly() {
1070 >    public void testAcquireSharedInterruptibly() {
1071          final BooleanLatch l = new BooleanLatch();
1072  
1073          Thread t = new Thread(new Runnable() {
# Line 576 | Line 1097 | public class AbstractQueuedSynchronizerT
1097      /**
1098       * acquireSharedTimed returns after release
1099       */
1100 <    public void testLatchTimedacquireSharedInterruptibly() {
1100 >    public void testAsquireSharedTimed() {
1101          final BooleanLatch l = new BooleanLatch();
1102  
1103          Thread t = new Thread(new Runnable() {
# Line 606 | Line 1127 | public class AbstractQueuedSynchronizerT
1127      /**
1128       * acquireSharedInterruptibly throws IE if interrupted before released
1129       */
1130 <    public void testLatchAcquireSharedInterruptibly_InterruptedException() {
1130 >    public void testAcquireSharedInterruptibly_InterruptedException() {
1131          final BooleanLatch l = new BooleanLatch();
1132          Thread t = new Thread(new Runnable() {
1133                  public void run() {
# Line 630 | Line 1151 | public class AbstractQueuedSynchronizerT
1151      /**
1152       * acquireSharedTimed throws IE if interrupted before released
1153       */
1154 <    public void testLatchTimedAwait_InterruptedException() {
1154 >    public void testAcquireSharedNanos_InterruptedException() {
1155          final BooleanLatch l = new BooleanLatch();
1156          Thread t = new Thread(new Runnable() {
1157                  public void run() {
# Line 655 | Line 1176 | public class AbstractQueuedSynchronizerT
1176      /**
1177       * acquireSharedTimed times out if not released before timeout
1178       */
1179 <    public void testLatchAwaitTimeout() {
1179 >    public void testAcquireSharedNanos_Timeout() {
1180          final BooleanLatch l = new BooleanLatch();
1181          Thread t = new Thread(new Runnable() {
1182                  public void run() {
# Line 676 | Line 1197 | public class AbstractQueuedSynchronizerT
1197              unexpectedException();
1198          }
1199      }
1200 +
1201      
1202   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines