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.84 by jsr166, Sun Aug 11 22:29:27 2019 UTC vs.
Revision 1.87 by jsr166, Thu Sep 5 21:39:57 2019 UTC

# Line 676 | Line 676 | public class LinkedBlockingDequeTest ext
676  
677                  pleaseInterrupt.countDown();
678                  try {
679 <                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
679 >                    q.offer(new Object(), LONGER_DELAY_MS, MILLISECONDS);
680                      shouldThrow();
681                  } catch (InterruptedException success) {}
682                  assertFalse(Thread.interrupted());
683
684                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
683              }});
684  
685          await(pleaseInterrupt);
# Line 778 | Line 776 | public class LinkedBlockingDequeTest ext
776          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
777          Thread t = newStartedThread(new CheckedRunnable() {
778              public void realRun() throws InterruptedException {
781                long startTime = System.nanoTime();
779                  for (int i = 0; i < SIZE; i++)
780                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
781  
# Line 791 | Line 788 | public class LinkedBlockingDequeTest ext
788  
789                  pleaseInterrupt.countDown();
790                  try {
791 <                    q.poll(LONG_DELAY_MS, MILLISECONDS);
791 >                    q.poll(LONGER_DELAY_MS, MILLISECONDS);
792                      shouldThrow();
793                  } catch (InterruptedException success) {}
794                  assertFalse(Thread.interrupted());
798
799                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
795              }});
796  
797          await(pleaseInterrupt);
# Line 924 | Line 919 | public class LinkedBlockingDequeTest ext
919  
920                  pleaseInterrupt.countDown();
921                  try {
922 <                    q.offerFirst(new Object(), LONG_DELAY_MS, MILLISECONDS);
922 >                    q.offerFirst(new Object(), LONGER_DELAY_MS, MILLISECONDS);
923                      shouldThrow();
924                  } catch (InterruptedException success) {}
925                  assertFalse(Thread.interrupted());
931
932                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
926              }});
927  
928          await(pleaseInterrupt);
# Line 1097 | Line 1090 | public class LinkedBlockingDequeTest ext
1090          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1091          Thread t = newStartedThread(new CheckedRunnable() {
1092              public void realRun() throws InterruptedException {
1100                long startTime = System.nanoTime();
1093                  for (int i = 0; i < SIZE; i++)
1094                      assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS));
1095  
# Line 1110 | Line 1102 | public class LinkedBlockingDequeTest ext
1102  
1103                  pleaseInterrupt.countDown();
1104                  try {
1105 <                    q.pollFirst(LONG_DELAY_MS, MILLISECONDS);
1105 >                    q.pollFirst(LONGER_DELAY_MS, MILLISECONDS);
1106                      shouldThrow();
1107                  } catch (InterruptedException success) {}
1108                  assertFalse(Thread.interrupted());
1117
1118                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1109              }});
1110  
1111          await(pleaseInterrupt);
# Line 1291 | Line 1281 | public class LinkedBlockingDequeTest ext
1281  
1282                  pleaseInterrupt.countDown();
1283                  try {
1284 <                    q.offerLast(new Object(), LONG_DELAY_MS, MILLISECONDS);
1284 >                    q.offerLast(new Object(), LONGER_DELAY_MS, MILLISECONDS);
1285                      shouldThrow();
1286                  } catch (InterruptedException success) {}
1297
1298                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1287              }});
1288  
1289          await(pleaseInterrupt);
# Line 1382 | Line 1370 | public class LinkedBlockingDequeTest ext
1370          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1371          Thread t = newStartedThread(new CheckedRunnable() {
1372              public void realRun() throws InterruptedException {
1385                long startTime = System.nanoTime();
1373                  for (int i = 0; i < SIZE; i++)
1374                      assertEquals(SIZE - i - 1,
1375                                   q.pollLast(LONG_DELAY_MS, MILLISECONDS));
# Line 1396 | Line 1383 | public class LinkedBlockingDequeTest ext
1383  
1384                  pleaseInterrupt.countDown();
1385                  try {
1386 <                    q.pollLast(LONG_DELAY_MS, MILLISECONDS);
1386 >                    q.pollLast(LONGER_DELAY_MS, MILLISECONDS);
1387                      shouldThrow();
1388                  } catch (InterruptedException success) {}
1389                  assertFalse(Thread.interrupted());
1403
1404                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
1390              }});
1391  
1392          await(pleaseInterrupt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines