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

Comparing jsr166/src/test/tck/LinkedBlockingQueueTest.java (file contents):
Revision 1.72 by jsr166, Sun May 14 00:56:43 2017 UTC vs.
Revision 1.76 by jsr166, Fri Aug 4 03:30:21 2017 UTC

# Line 314 | Line 314 | public class LinkedBlockingQueueTest ext
314                  pleaseTake.countDown();
315                  q.put(86);
316  
317 +                Thread.currentThread().interrupt();
318 +                try {
319 +                    q.put(99);
320 +                    shouldThrow();
321 +                } catch (InterruptedException success) {}
322 +                assertFalse(Thread.interrupted());
323 +
324                  pleaseInterrupt.countDown();
325                  try {
326                      q.put(99);
# Line 343 | Line 350 | public class LinkedBlockingQueueTest ext
350              public void realRun() throws InterruptedException {
351                  q.put(new Object());
352                  q.put(new Object());
353 +
354                  long startTime = System.nanoTime();
355                  assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS));
356                  assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
357 +
358 +                Thread.currentThread().interrupt();
359 +                try {
360 +                    q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
361 +                    shouldThrow();
362 +                } catch (InterruptedException success) {}
363 +                assertFalse(Thread.interrupted());
364 +
365                  pleaseInterrupt.countDown();
366                  try {
367                      q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
# Line 449 | Line 465 | public class LinkedBlockingQueueTest ext
465          Thread t = newStartedThread(new CheckedRunnable() {
466              public void realRun() throws InterruptedException {
467                  long startTime = System.nanoTime();
468 <                for (int i = 0; i < SIZE; ++i) {
468 >                for (int i = 0; i < SIZE; i++)
469                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
470 <                }
470 >
471 >                Thread.currentThread().interrupt();
472 >                try {
473 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
474 >                    shouldThrow();
475 >                } catch (InterruptedException success) {}
476 >                assertFalse(Thread.interrupted());
477  
478                  pleaseInterrupt.countDown();
479                  try {
# Line 774 | Line 796 | public class LinkedBlockingQueueTest ext
796      }
797  
798      /**
799 <     * A deserialized serialized queue has same elements in same order
799 >     * A deserialized/reserialized queue has same elements in same order
800       */
801      public void testSerialization() throws Exception {
802          Queue x = populatedQueue(SIZE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines