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.77 by jsr166, Sun May 14 00:56:43 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 761 | 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 1063 | 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));
1068                }
1081  
1082                  Thread.currentThread().interrupt();
1083                  try {
# Line 1331 | 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));
1337                }
1349  
1350                  Thread.currentThread().interrupt();
1351                  try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines