X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fconcurrency%2FReadWriteLockTest.java;h=5b0d510e1806fd03fdb80facdc672e3ea2267f28;hb=4a575582a5c2999bd816b197d9cf274b4b3ddcd7;hp=d17b3d92fa66bc1bbfb9bce90437f54a4f48171c;hpb=17775e14ecfb286e59f67117e5cee7e21e95ab1f;p=utils diff --git a/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java b/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java index d17b3d92..5b0d510e 100644 --- a/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java +++ b/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java @@ -12,10 +12,9 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package org.wamblee.concurrency; -import junit.framework.Assert; import junit.framework.TestCase; /** @@ -25,11 +24,11 @@ import junit.framework.TestCase; * @see ReadWriteLock */ public class ReadWriteLockTest extends TestCase { - private static final int HALF_SECOND = 500; + private static final int HALF_SECOND = 100; - private static final int ONE_SECOND = 1000; + private static final int ONE_SECOND = 200; - private static final int TWO_SECONDS = 2000; + private static final int TWO_SECONDS = 400; private ReadWriteLock lock; private int nReaders; private int nWriters; @@ -466,7 +465,7 @@ class ReadLocker implements Runnable { try { Thread.sleep(sleepTime); } catch (InterruptedException e) { - Assert.fail("ReadLocker thread was interrupted." + + throw new RuntimeException("ReadLocker thread was interrupted." + Thread.currentThread()); } @@ -499,7 +498,7 @@ class WriteLocker implements Runnable { try { Thread.sleep(sleepTime); } catch (InterruptedException e) { - Assert.fail("WriteLocker thread was interrupted: " + + throw new RuntimeException("WriteLocker thread was interrupted: " + Thread.currentThread()); }