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

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.76 by jsr166, Sun May 14 00:48:20 2017 UTC vs.
Revision 1.79 by jsr166, Sun May 14 04:02:06 2017 UTC

# Line 626 | Line 626 | public class LinkedBlockingDequeTest ext
626                  pleaseTake.countDown();
627                  q.put(86);
628  
629 +                Thread.currentThread().interrupt();
630 +                try {
631 +                    q.put(99);
632 +                    shouldThrow();
633 +                } catch (InterruptedException success) {}
634 +                assertFalse(Thread.interrupted());
635 +
636                  pleaseInterrupt.countDown();
637                  try {
638                      q.put(99);
# Line 663 | Line 670 | public class LinkedBlockingDequeTest ext
670                      q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
671                      shouldThrow();
672                  } catch (InterruptedException success) {}
673 +                assertFalse(Thread.interrupted());
674              }});
675  
676          await(pleaseInterrupt);
# Line 760 | Line 768 | public class LinkedBlockingDequeTest ext
768          Thread t = newStartedThread(new CheckedRunnable() {
769              public void realRun() throws InterruptedException {
770                  long startTime = System.nanoTime();
771 <                for (int i = 0; i < SIZE; ++i) {
771 >                for (int i = 0; i < SIZE; i++)
772                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
773 <                }
773 >
774 >                Thread.currentThread().interrupt();
775 >                try {
776 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
777 >                    shouldThrow();
778 >                } catch (InterruptedException success) {}
779 >                assertFalse(Thread.interrupted());
780  
781                  pleaseInterrupt.countDown();
782                  try {
# Line 893 | Line 907 | public class LinkedBlockingDequeTest ext
907                      q.offerFirst(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
908                      shouldThrow();
909                  } catch (InterruptedException success) {}
910 +                assertFalse(Thread.interrupted());
911              }});
912  
913          await(pleaseInterrupt);
# Line 1061 | Line 1076 | public class LinkedBlockingDequeTest ext
1076          Thread t = newStartedThread(new CheckedRunnable() {
1077              public void realRun() throws InterruptedException {
1078                  long startTime = System.nanoTime();
1079 <                for (int i = 0; i < SIZE; ++i) {
1079 >                for (int i = 0; i < SIZE; i++)
1080                      assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS));
1066                }
1081  
1082                  Thread.currentThread().interrupt();
1083                  try {
# Line 1116 | Line 1130 | public class LinkedBlockingDequeTest ext
1130                      q.pollFirst(LONG_DELAY_MS, MILLISECONDS);
1131                      shouldThrow();
1132                  } catch (InterruptedException success) {}
1133 +                assertFalse(Thread.interrupted());
1134                  assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1135              }});
1136  
# Line 1328 | Line 1343 | public class LinkedBlockingDequeTest ext
1343          Thread t = newStartedThread(new CheckedRunnable() {
1344              public void realRun() throws InterruptedException {
1345                  long startTime = System.nanoTime();
1346 <                for (int i = 0; i < SIZE; ++i) {
1346 >                for (int i = 0; i < SIZE; i++)
1347                      assertEquals(SIZE - i - 1,
1348                                   q.pollLast(LONG_DELAY_MS, MILLISECONDS));
1334                }
1349  
1350                  Thread.currentThread().interrupt();
1351                  try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines