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.24 by jsr166, Wed Aug 25 00:07:03 2010 UTC

# Line 14 | Line 14 | import java.io.*;
14  
15   public class SemaphoreTest extends JSR166TestCase {
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(SemaphoreTest.class);
# 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