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

Comparing jsr166/src/test/tck/CountDownLatchTest.java (file contents):
Revision 1.16 by jsr166, Tue Mar 15 19:47:06 2011 UTC vs.
Revision 1.18 by jsr166, Tue May 24 23:35:40 2011 UTC

# Line 66 | Line 66 | public class CountDownLatchTest extends
66  
67          t.start();
68          assertEquals(l.getCount(), 2);
69 <        Thread.sleep(SHORT_DELAY_MS);
69 >        delay(SHORT_DELAY_MS);
70          l.countDown();
71          assertEquals(l.getCount(), 1);
72          l.countDown();
# Line 89 | Line 89 | public class CountDownLatchTest extends
89  
90          t.start();
91          assertEquals(l.getCount(), 2);
92 <        Thread.sleep(SHORT_DELAY_MS);
92 >        delay(SHORT_DELAY_MS);
93          l.countDown();
94          assertEquals(l.getCount(), 1);
95          l.countDown();
# Line 126 | Line 126 | public class CountDownLatchTest extends
126              }});
127  
128          t.start();
129 <        Thread.sleep(SHORT_DELAY_MS);
129 >        delay(SHORT_DELAY_MS);
130          assertEquals(l.getCount(), 1);
131          t.interrupt();
132          t.join();
# Line 154 | Line 154 | public class CountDownLatchTest extends
154       */
155      public void testToString() {
156          CountDownLatch s = new CountDownLatch(2);
157 <        String us = s.toString();
158 <        assertTrue(us.indexOf("Count = 2") >= 0);
157 >        assertTrue(s.toString().contains("Count = 2"));
158          s.countDown();
159 <        String s1 = s.toString();
161 <        assertTrue(s1.indexOf("Count = 1") >= 0);
159 >        assertTrue(s.toString().contains("Count = 1"));
160          s.countDown();
161 <        String s2 = s.toString();
164 <        assertTrue(s2.indexOf("Count = 0") >= 0);
161 >        assertTrue(s.toString().contains("Count = 0"));
162      }
163  
164   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines