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

Comparing jsr166/src/test/tck/ReentrantLockTest.java (file contents):
Revision 1.48 by jsr166, Sat May 21 06:24:33 2011 UTC vs.
Revision 1.50 by jsr166, Tue May 31 16:16:24 2011 UTC

# Line 7 | Line 7
7   */
8  
9   import junit.framework.*;
10 < import java.util.concurrent.locks.*;
11 < import java.util.concurrent.*;
10 > import java.util.concurrent.locks.Condition;
11 > import java.util.concurrent.locks.ReentrantLock;
12 > import java.util.concurrent.CountDownLatch;
13 > import java.util.concurrent.CyclicBarrier;
14   import static java.util.concurrent.TimeUnit.MILLISECONDS;
15   import java.util.*;
14 import java.io.*;
16  
17   public class ReentrantLockTest extends JSR166TestCase {
18      public static void main(String[] args) {
# Line 286 | Line 287 | public class ReentrantLockTest extends J
287      }
288  
289      /**
290 <     * hasQueuedThread reports whether a thread is queued.
290 >     * hasQueuedThread reports whether a thread is queued
291       */
292      public void testHasQueuedThread()      { testHasQueuedThread(false); }
293      public void testHasQueuedThread_fair() { testHasQueuedThread(true); }
# Line 347 | Line 348 | public class ReentrantLockTest extends J
348      }
349  
350      /**
351 <     * timed tryLock is interruptible.
351 >     * timed tryLock is interruptible
352       */
353      public void testTryLock_Interruptible()      { testTryLock_Interruptible(false); }
354      public void testTryLock_Interruptible_fair() { testTryLock_Interruptible(true); }
# Line 985 | Line 986 | public class ReentrantLockTest extends J
986      }
987  
988      /**
989 <     * signal wakes up waiting threads in FIFO order.
989 >     * signal wakes up waiting threads in FIFO order
990       */
991      public void testSignalWakesFifo()      { testSignalWakesFifo(false); }
992      public void testSignalWakesFifo_fair() { testSignalWakesFifo(true); }
# Line 1110 | Line 1111 | public class ReentrantLockTest extends J
1111      public void testToString_fair() { testToString(true); }
1112      public void testToString(boolean fair) {
1113          ReentrantLock lock = new ReentrantLock(fair);
1114 <        String us = lock.toString();
1114 <        assertTrue(us.indexOf("Unlocked") >= 0);
1114 >        assertTrue(lock.toString().contains("Unlocked"));
1115          lock.lock();
1116 <        String ls = lock.toString();
1117 <        assertTrue(ls.indexOf("Locked") >= 0);
1116 >        assertTrue(lock.toString().contains("Locked"));
1117 >        lock.unlock();
1118 >        assertTrue(lock.toString().contains("Unlocked"));
1119      }
1120   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines