X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fconcurrency%2FReadWriteLockTest.java;h=4b4bd42628046dc34d2a24a378402dc9b828d1ea;hb=20b609f290912dd2a186ff7240a1c0be93731cca;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..4b4bd426 100644 --- a/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java +++ b/support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java @@ -15,7 +15,6 @@ */ 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()); }