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

Comparing jsr166/src/test/tck/SemaphoreTest.java (file contents):
Revision 1.20 by jsr166, Sat Nov 21 02:07:27 2009 UTC vs.
Revision 1.23 by jsr166, Tue Dec 1 06:28:44 2009 UTC

# Line 49 | Line 49 | public class SemaphoreTest extends JSR16
49  
50  
51      /**
52 <     * A runnable calling acquire that expects to be
53 <     * interrupted
52 >     * A runnable calling acquire that expects to be interrupted
53       */
54      class InterruptedLockRunnable extends CheckedInterruptedRunnable {
55          final Semaphore lock;
# Line 213 | Line 212 | public class SemaphoreTest extends JSR16
212          Thread t = new Thread(new CheckedRunnable() {
213              public void realRun() throws InterruptedException {
214                  s.release();
215 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
215 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
216                  s.release();
217 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
217 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
218              }});
219  
220          t.start();
# Line 595 | Line 594 | public class SemaphoreTest extends JSR16
594          final Semaphore s = new Semaphore(1, true);
595          Thread t = new Thread(new CheckedRunnable() {
596              public void realRun() throws InterruptedException {
597 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
598 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
599 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
600 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
601 <                threadAssertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
597 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
598 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
599 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
600 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
601 >                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
602              }});
603  
604          t.start();
# Line 619 | Line 618 | public class SemaphoreTest extends JSR16
618          final Semaphore s = new Semaphore(2, true);
619          Thread t = new Thread(new CheckedRunnable() {
620              public void realRun() throws InterruptedException {
621 <                threadAssertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
621 >                assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
622                  s.release(2);
623 <                threadAssertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
623 >                assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
624                  s.release(2);
625              }});
626  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines