--- jsr166/src/test/tck/ReentrantLockTest.java 2004/01/07 20:49:53 1.17 +++ jsr166/src/test/tck/ReentrantLockTest.java 2004/01/10 01:41:59 1.18 @@ -1016,4 +1016,16 @@ public class ReentrantLockTest extends J } } + /** + * toString indicates current lock state + */ + public void testToString() { + ReentrantLock lock = new ReentrantLock(); + String us = lock.toString(); + assertTrue(us.indexOf("Unlocked") >= 0); + lock.lock(); + String ls = lock.toString(); + assertTrue(ls.indexOf("Locked") >= 0); + } + }