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.13 by jsr166, Tue Dec 1 07:23:09 2009 UTC vs.
Revision 1.16 by dl, Fri May 6 11:22:07 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   * Other contributors include Andrew Wright, Jeffrey Hayes,
6   * Pat Fisher, Mike Judd.
7   */
# Line 14 | Line 14 | import static java.util.concurrent.TimeU
14   public class ExchangerTest extends JSR166TestCase {
15  
16      public static void main(String[] args) {
17 <        junit.textui.TestRunner.run (suite());
17 >        junit.textui.TestRunner.run(suite());
18      }
19      public static Test suite() {
20          return new TestSuite(ExchangerTest.class);
# Line 75 | Line 75 | public class ExchangerTest extends JSR16
75              }});
76  
77          t.start();
78 <        Thread.sleep(SHORT_DELAY_MS);
78 >        delay(SHORT_DELAY_MS);
79          t.interrupt();
80          t.join();
81      }
# Line 91 | Line 91 | public class ExchangerTest extends JSR16
91              }});
92  
93          t.start();
94 <        Thread.sleep(SHORT_DELAY_MS);
94 >        delay(SHORT_DELAY_MS);
95          t.interrupt();
96          t.join();
97      }
# Line 123 | Line 123 | public class ExchangerTest extends JSR16
123          Thread t2 = new Thread(new CheckedRunnable() {
124              public void realRun() throws InterruptedException {
125                  assertSame(one, e.exchange(two));
126 <                Thread.sleep(SMALL_DELAY_MS);
126 >                delay(SMALL_DELAY_MS);
127                  assertSame(three, e.exchange(one));
128              }});
129          Thread t3 = new Thread(new CheckedRunnable() {
130              public void realRun() throws InterruptedException {
131 <                Thread.sleep(SMALL_DELAY_MS);
131 >                delay(SMALL_DELAY_MS);
132                  assertSame(one, e.exchange(three));
133              }});
134  
135          t1.start();
136          t2.start();
137          t3.start();
138 <        Thread.sleep(SHORT_DELAY_MS);
138 >        delay(SHORT_DELAY_MS);
139          t1.interrupt();
140          t1.join();
141          t2.join();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines