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

Comparing jsr166/src/test/tck/ReentrantReadWriteLockTest.java (file contents):
Revision 1.68 by jsr166, Wed Dec 31 05:04:04 2014 UTC vs.
Revision 1.71 by jsr166, Fri Feb 27 21:43:18 2015 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 < import junit.framework.*;
9 > import static java.util.concurrent.TimeUnit.MILLISECONDS;
10 >
11 > import java.util.Arrays;
12 > import java.util.Collection;
13 > import java.util.HashSet;
14 > import java.util.concurrent.CountDownLatch;
15   import java.util.concurrent.atomic.AtomicBoolean;
16   import java.util.concurrent.locks.Condition;
17   import java.util.concurrent.locks.Lock;
18   import java.util.concurrent.locks.ReentrantReadWriteLock;
19 < import java.util.concurrent.CountDownLatch;
20 < import static java.util.concurrent.TimeUnit.MILLISECONDS;
21 < import java.util.*;
19 >
20 > import junit.framework.AssertionFailedError;
21 > import junit.framework.Test;
22 > import junit.framework.TestSuite;
23  
24   public class ReentrantReadWriteLockTest extends JSR166TestCase {
25      public static void main(String[] args) {
# Line 168 | Line 174 | public class ReentrantReadWriteLockTest
174              java.util.Date d = new java.util.Date();
175              assertTrue(c.awaitUntil(new java.util.Date(d.getTime() + 2 * LONG_DELAY_MS)));
176              break;
177 +        default:
178 +            throw new AssertionError();
179          }
180      }
181  
# Line 949 | Line 957 | public class ReentrantReadWriteLockTest
957              assertFalse(c.await(timeoutMillis, MILLISECONDS));
958              assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
959              lock.writeLock().unlock();
960 <        } catch (InterruptedException e) {
953 <            threadUnexpectedException(e);
954 <        }
960 >        } catch (InterruptedException fail) { threadUnexpectedException(fail); }
961      }
962  
963      /**
# Line 971 | Line 977 | public class ReentrantReadWriteLockTest
977              assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + timeoutMillis)));
978              assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
979              lock.writeLock().unlock();
980 <        } catch (InterruptedException e) {
975 <            threadUnexpectedException(e);
976 <        }
980 >        } catch (InterruptedException fail) { threadUnexpectedException(fail); }
981      }
982  
983      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines