[cvs] / jsr166 / src / test / tck / ArrayBlockingQueueTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/ArrayBlockingQueueTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20, Sat Nov 21 17:38:05 2009 UTC revision 1.21, Sat Nov 21 19:11:53 2009 UTC
# Line 448  Line 448 
448       * returning timeout status       * returning timeout status
449       */       */
450      public void testInterruptedTimedPoll() throws InterruptedException {      public void testInterruptedTimedPoll() throws InterruptedException {
451          Thread t = new ThreadShouldThrow(InterruptedException.class) {          Thread t = new Thread(new CheckedRunnable() {
452              public void realRun() throws InterruptedException {              public void realRun() throws InterruptedException {
453                  ArrayBlockingQueue q = populatedQueue(SIZE);                  ArrayBlockingQueue q = populatedQueue(SIZE);
454                  for (int i = 0; i < SIZE; ++i) {                  for (int i = 0; i < SIZE; ++i) {
455                      threadAssertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue());                      assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue());
456                  }                  }
457                  q.poll(MEDIUM_DELAY_MS, MILLISECONDS);                  try {
458              }};                      q.poll(SMALL_DELAY_MS, MILLISECONDS);
459                    } catch (InterruptedException success) {}
460                }});
461    
462          t.start();          t.start();
463          Thread.sleep(SMALL_DELAY_MS);          Thread.sleep(SHORT_DELAY_MS);
464          t.interrupt();          t.interrupt();
465          t.join();          t.join();
466      }      }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8