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.10 by jsr166, Sat Nov 21 02:07:26 2009 UTC vs.
Revision 1.11 by jsr166, Sat Nov 21 02:33:20 2009 UTC

# Line 9 | Line 9
9   import junit.framework.*;
10   import java.util.*;
11   import java.util.concurrent.*;
12 + import static java.util.concurrent.TimeUnit.MILLISECONDS;
13  
14   public class ExchangerTest extends JSR166TestCase {
15  
# Line 52 | Line 53 | public class ExchangerTest extends JSR16
53          final Exchanger e = new Exchanger();
54          Thread t1 = new Thread(new CheckedRunnable() {
55              public void realRun() throws Exception {
56 <                Object v = e.exchange(one, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
56 >                Object v = e.exchange(one, SHORT_DELAY_MS, MILLISECONDS);
57                  threadAssertEquals(v, two);
58 <                Object w = e.exchange(v, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
58 >                Object w = e.exchange(v, SHORT_DELAY_MS, MILLISECONDS);
59                  threadAssertEquals(w, one);
60              }});
61          Thread t2 = new Thread(new CheckedRunnable() {
62              public void realRun() throws Exception {
63 <                Object v = e.exchange(two, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
63 >                Object v = e.exchange(two, SHORT_DELAY_MS, MILLISECONDS);
64                  threadAssertEquals(v, one);
65 <                Object w = e.exchange(v, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
65 >                Object w = e.exchange(v, SHORT_DELAY_MS, MILLISECONDS);
66                  threadAssertEquals(w, two);
67              }});
68  
# Line 94 | Line 95 | public class ExchangerTest extends JSR16
95          final Exchanger e = new Exchanger();
96          Thread t = new Thread(new CheckedInterruptedRunnable() {
97              public void realRun() throws Exception {
98 <                e.exchange(null, MEDIUM_DELAY_MS, TimeUnit.MILLISECONDS);
98 >                e.exchange(null, MEDIUM_DELAY_MS, MILLISECONDS);
99              }});
100  
101          t.start();
# Line 110 | Line 111 | public class ExchangerTest extends JSR16
111          Thread t = new Thread(new CheckedRunnable() {
112              public void realRun() throws Exception {
113                  try {
114 <                    e.exchange(null, SHORT_DELAY_MS, TimeUnit.MILLISECONDS);
114 >                    e.exchange(null, SHORT_DELAY_MS, MILLISECONDS);
115                      threadShouldThrow();
116                  } catch (TimeoutException success) {}
117              }});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines