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.78 by jsr166, Sun May 14 01:30:34 2017 UTC

# Line 761 | Line 761 | public class LinkedBlockingDequeTest ext
761          Thread t = newStartedThread(new CheckedRunnable() {
762              public void realRun() throws InterruptedException {
763                  long startTime = System.nanoTime();
764 <                for (int i = 0; i < SIZE; ++i) {
764 >                for (int i = 0; i < SIZE; i++)
765                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
766 <                }
766 >
767 >                Thread.currentThread().interrupt();
768 >                try {
769 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
770 >                    shouldThrow();
771 >                } catch (InterruptedException success) {}
772 >                assertFalse(Thread.interrupted());
773  
774                  pleaseInterrupt.countDown();
775                  try {
# Line 1063 | Line 1069 | public class LinkedBlockingDequeTest ext
1069          Thread t = newStartedThread(new CheckedRunnable() {
1070              public void realRun() throws InterruptedException {
1071                  long startTime = System.nanoTime();
1072 <                for (int i = 0; i < SIZE; ++i) {
1072 >                for (int i = 0; i < SIZE; i++)
1073                      assertEquals(i, q.pollFirst(LONG_DELAY_MS, MILLISECONDS));
1068                }
1074  
1075                  Thread.currentThread().interrupt();
1076                  try {
# Line 1331 | Line 1336 | public class LinkedBlockingDequeTest ext
1336          Thread t = newStartedThread(new CheckedRunnable() {
1337              public void realRun() throws InterruptedException {
1338                  long startTime = System.nanoTime();
1339 <                for (int i = 0; i < SIZE; ++i) {
1339 >                for (int i = 0; i < SIZE; i++)
1340                      assertEquals(SIZE - i - 1,
1341                                   q.pollLast(LONG_DELAY_MS, MILLISECONDS));
1337                }
1342  
1343                  Thread.currentThread().interrupt();
1344                  try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines