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

Comparing jsr166/src/test/tck/ExchangerTest.java (file contents):
Revision 1.17 by jsr166, Sun May 15 16:58:16 2011 UTC vs.
Revision 1.20 by jsr166, Sun May 29 06:48:42 2011 UTC

# Line 101 | Line 101 | public class ExchangerTest extends JSR16
101          final Exchanger e = new Exchanger();
102          Thread t = newStartedThread(new CheckedRunnable() {
103              public void realRun() throws Exception {
104                long timeoutMillis = SHORT_DELAY_MS;
104                  long startTime = System.nanoTime();
105                  try {
106 <                    e.exchange(null, timeoutMillis, MILLISECONDS);
106 >                    e.exchange(null, timeoutMillis(), MILLISECONDS);
107                      shouldThrow();
108 <                } catch (TimeoutException success) {
109 <                    assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
111 <                }
108 >                } catch (TimeoutException success) {}
109 >                assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
110              }});
111  
112          awaitTermination(t);
# Line 117 | Line 115 | public class ExchangerTest extends JSR16
115      /**
116       * If one exchanging thread is interrupted, another succeeds.
117       */
118 <    public void testReplacementAfterExchange() throws InterruptedException {
118 >    public void testReplacementAfterExchange() {
119          final Exchanger e = new Exchanger();
120          final CountDownLatch exchanged = new CountDownLatch(2);
121          final CountDownLatch interrupted = new CountDownLatch(1);
# Line 142 | Line 140 | public class ExchangerTest extends JSR16
140  
141          await(exchanged);
142          t1.interrupt();
145        interrupted.countDown();
143          awaitTermination(t1);
144 +        interrupted.countDown();
145          awaitTermination(t2);
146          awaitTermination(t3);
147      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines