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.71 by jsr166, Fri Feb 27 21:43:18 2015 UTC vs.
Revision 1.74 by jsr166, Sun May 24 01:42:14 2015 UTC

# Line 23 | Line 23 | import junit.framework.TestSuite;
23  
24   public class ReentrantReadWriteLockTest extends JSR166TestCase {
25      public static void main(String[] args) {
26 <        junit.textui.TestRunner.run(suite());
26 >        main(suite(), args);
27      }
28      public static Test suite() {
29          return new TestSuite(ReentrantReadWriteLockTest.class);
# Line 236 | Line 236 | public class ReentrantReadWriteLockTest
236          }
237          for (int i = SIZE; i > 0; i--) {
238              lock.writeLock().unlock();
239 <            assertEquals(i-1,lock.getWriteHoldCount());
239 >            assertEquals(i - 1,lock.getWriteHoldCount());
240          }
241      }
242  
# Line 253 | Line 253 | public class ReentrantReadWriteLockTest
253          }
254          for (int i = SIZE; i > 0; i--) {
255              lock.writeLock().unlock();
256 <            assertEquals(i-1,lock.writeLock().getHoldCount());
256 >            assertEquals(i - 1,lock.writeLock().getHoldCount());
257          }
258      }
259  
# Line 270 | Line 270 | public class ReentrantReadWriteLockTest
270          }
271          for (int i = SIZE; i > 0; i--) {
272              lock.readLock().unlock();
273 <            assertEquals(i-1,lock.getReadHoldCount());
273 >            assertEquals(i - 1,lock.getReadHoldCount());
274          }
275      }
276  
# Line 830 | Line 830 | public class ReentrantReadWriteLockTest
830              new PublicReentrantReadWriteLock(fair);
831          try {
832              lock.writeLock().lockInterruptibly();
833 <        } catch (InterruptedException ie) {
834 <            threadUnexpectedException(ie);
835 <        }
833 >        } catch (InterruptedException fail) { threadUnexpectedException(fail); }
834          Thread t = newStartedThread(new CheckedInterruptedRunnable() {
835              public void realRun() throws InterruptedException {
836                  lock.writeLock().lockInterruptibly();
# Line 857 | Line 855 | public class ReentrantReadWriteLockTest
855              lock.readLock().lockInterruptibly();
856              lock.readLock().unlock();
857              lock.writeLock().lockInterruptibly();
858 <        } catch (InterruptedException ie) {
861 <            threadUnexpectedException(ie);
862 <        }
858 >        } catch (InterruptedException fail) { threadUnexpectedException(fail); }
859          Thread t = newStartedThread(new CheckedInterruptedRunnable() {
860              public void realRun() throws InterruptedException {
861                  lock.readLock().lockInterruptibly();
# Line 885 | Line 881 | public class ReentrantReadWriteLockTest
881                  await(c, awaitMethod);
882                  shouldThrow();
883              } catch (IllegalMonitorStateException success) {
884 <            } catch (InterruptedException e) { threadUnexpectedException(e); }
884 >            } catch (InterruptedException fail) {
885 >                threadUnexpectedException(fail);
886 >            }
887              assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
888          }
889      }
# Line 936 | Line 934 | public class ReentrantReadWriteLockTest
934              assertTrue(nanosRemaining <= 0);
935              assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
936              lock.writeLock().unlock();
937 <        } catch (InterruptedException e) {
940 <            threadUnexpectedException(e);
941 <        }
937 >        } catch (InterruptedException fail) { threadUnexpectedException(fail); }
938      }
939  
940      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines