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

Comparing jsr166/src/test/tck/ArrayBlockingQueueTest.java (file contents):
Revision 1.23 by jsr166, Sat Nov 21 21:00:34 2009 UTC vs.
Revision 1.24 by jsr166, Sat Nov 21 22:00:46 2009 UTC

# Line 350 | Line 350 | public class ArrayBlockingQueueTest exte
350       */
351      public void testTimedOffer() throws InterruptedException {
352          final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
353 <        Thread t = new ThreadShouldThrow(InterruptedException.class) {
353 >        Thread t = new Thread(new CheckedRunnable() {
354              public void realRun() throws InterruptedException {
355                  q.put(new Object());
356                  q.put(new Object());
357 <                threadAssertFalse(q.offer(new Object(), SHORT_DELAY_MS/2, MILLISECONDS));
358 <                q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
359 <            }};
357 >                assertFalse(q.offer(new Object(), SHORT_DELAY_MS/2, MILLISECONDS));
358 >                try {
359 >                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
360 >                    shouldThrow();
361 >                } catch (InterruptedException success) {}
362 >            }});
363  
364          t.start();
365          Thread.sleep(SHORT_DELAY_MS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines