[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.23, Sat Nov 21 21:00:34 2009 UTC revision 1.24, Sat Nov 21 22:00:46 2009 UTC
# Line 350  Line 350 
350       */       */
351      public void testTimedOffer() throws InterruptedException {      public void testTimedOffer() throws InterruptedException {
352          final ArrayBlockingQueue q = new ArrayBlockingQueue(2);          final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
353          Thread t = new ThreadShouldThrow(InterruptedException.class) {          Thread t = new Thread(new CheckedRunnable() {
354              public void realRun() throws InterruptedException {              public void realRun() throws InterruptedException {
355                  q.put(new Object());                  q.put(new Object());
356                  q.put(new Object());                  q.put(new Object());
357                  threadAssertFalse(q.offer(new Object(), SHORT_DELAY_MS/2, MILLISECONDS));                  assertFalse(q.offer(new Object(), SHORT_DELAY_MS/2, MILLISECONDS));
358                    try {
359                  q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);                  q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
360              }};                      shouldThrow();
361                    } catch (InterruptedException success) {}
362                }});
363    
364          t.start();          t.start();
365          Thread.sleep(SHORT_DELAY_MS);          Thread.sleep(SHORT_DELAY_MS);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8