(no commit message)
[utils] / support / general / src / test / java / org / wamblee / concurrency / ReadWriteLockTest.java
index d17b3d92fa66bc1bbfb9bce90437f54a4f48171c..5b0d510e1806fd03fdb80facdc672e3ea2267f28 100644 (file)
  * 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());
         }