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.19 by jsr166, Fri May 27 19:40:19 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 74 | Line 74 | public class CountDownLatchTest extends
74          t.join();
75      }
76  
77
77      /**
78       * timed await returns after countDown to zero
79       */
# Line 89 | Line 88 | public class CountDownLatchTest extends
88  
89          t.start();
90          assertEquals(l.getCount(), 2);
91 <        Thread.sleep(SHORT_DELAY_MS);
91 >        delay(SHORT_DELAY_MS);
92          l.countDown();
93          assertEquals(l.getCount(), 1);
94          l.countDown();
# Line 126 | Line 125 | public class CountDownLatchTest extends
125              }});
126  
127          t.start();
128 <        Thread.sleep(SHORT_DELAY_MS);
128 >        delay(SHORT_DELAY_MS);
129          assertEquals(l.getCount(), 1);
130          t.interrupt();
131          t.join();
# Line 154 | Line 153 | public class CountDownLatchTest extends
153       */
154      public void testToString() {
155          CountDownLatch s = new CountDownLatch(2);
156 <        String us = s.toString();
158 <        assertTrue(us.indexOf("Count = 2") >= 0);
156 >        assertTrue(s.toString().contains("Count = 2"));
157          s.countDown();
158 <        String s1 = s.toString();
161 <        assertTrue(s1.indexOf("Count = 1") >= 0);
158 >        assertTrue(s.toString().contains("Count = 1"));
159          s.countDown();
160 <        String s2 = s.toString();
164 <        assertTrue(s2.indexOf("Count = 0") >= 0);
160 >        assertTrue(s.toString().contains("Count = 0"));
161      }
162  
163   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines