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.22 by jsr166, Tue Dec 1 06:03:49 2009 UTC vs.
Revision 1.25 by jsr166, Sat Oct 9 19:30:35 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 204 | Line 204 | public class SemaphoreTest extends JSR16
204  
205  
206      /**
207 <     *  A release in one thread enables a timed acquire in another thread
207 >     * A release in one thread enables a timed acquire in another thread
208       */
209      public void testTimedAcquireReleaseInDifferentThreads()
210          throws InterruptedException {
# Line 212 | 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 244 | Line 244 | public class SemaphoreTest extends JSR16
244      }
245  
246      /**
247 <     *  A waiting timed acquire blocks interruptibly
247 >     * A waiting timed acquire blocks interruptibly
248       */
249      public void testTryAcquire_InterruptedException()
250          throws InterruptedException {
# Line 594 | 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 667 | Line 667 | public class SemaphoreTest extends JSR16
667      }
668  
669      /**
670 <     *  A waiting tryAcquire blocks interruptibly
670 >     * A waiting tryAcquire blocks interruptibly
671       */
672      public void testTryAcquire_InterruptedException_fair()
673          throws InterruptedException {
# Line 684 | Line 684 | public class SemaphoreTest extends JSR16
684      }
685  
686      /**
687 <     *  A waiting tryAcquire(n) blocks interruptibly
687 >     * A waiting tryAcquire(n) blocks interruptibly
688       */
689      public void testTryAcquireN_InterruptedException_fair()
690          throws InterruptedException {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines