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

Comparing jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java (file contents):
Revision 1.16 by jsr166, Wed Aug 25 00:07:02 2010 UTC vs.
Revision 1.17 by jsr166, Thu Sep 16 00:52:49 2010 UTC

# Line 47 | Line 47 | public class AbstractQueuedLongSynchroni
47              return true;
48          }
49  
50 <        public AbstractQueuedLongSynchronizer.ConditionObject newCondition() { return new AbstractQueuedLongSynchronizer.ConditionObject(); }
50 >        public AbstractQueuedLongSynchronizer.ConditionObject newCondition() {
51 >            return new AbstractQueuedLongSynchronizer.ConditionObject();
52 >        }
53  
54      }
55  
# Line 348 | Line 350 | public class AbstractQueuedLongSynchroni
350          sync.acquire(1);
351          Thread t = new Thread(new CheckedRunnable() {
352              public void realRun() {
353 <                threadAssertFalse(sync.tryAcquire(1));
353 >                assertFalse(sync.tryAcquire(1));
354              }});
355  
356          t.start();
# Line 644 | Line 646 | public class AbstractQueuedLongSynchroni
646          Thread t = new Thread(new CheckedRunnable() {
647              public void realRun() throws InterruptedException {
648                  sync.acquire(1);
649 <                threadAssertFalse(sync.hasWaiters(c));
650 <                threadAssertEquals(0, sync.getWaitQueueLength(c));
649 >                assertFalse(sync.hasWaiters(c));
650 >                assertEquals(0, sync.getWaitQueueLength(c));
651                  c.await();
652                  sync.release(1);
653              }});
# Line 675 | Line 677 | public class AbstractQueuedLongSynchroni
677          Thread t1 = new Thread(new CheckedRunnable() {
678              public void realRun() throws InterruptedException {
679                  sync.acquire(1);
680 <                threadAssertFalse(sync.hasWaiters(c));
681 <                threadAssertEquals(0, sync.getWaitQueueLength(c));
680 >                assertFalse(sync.hasWaiters(c));
681 >                assertEquals(0, sync.getWaitQueueLength(c));
682                  c.await();
683                  sync.release(1);
684              }});
# Line 684 | Line 686 | public class AbstractQueuedLongSynchroni
686          Thread t2 = new Thread(new CheckedRunnable() {
687              public void realRun() throws InterruptedException {
688                  sync.acquire(1);
689 <                threadAssertTrue(sync.hasWaiters(c));
690 <                threadAssertEquals(1, sync.getWaitQueueLength(c));
689 >                assertTrue(sync.hasWaiters(c));
690 >                assertEquals(1, sync.getWaitQueueLength(c));
691                  c.await();
692                  sync.release(1);
693              }});
# Line 719 | Line 721 | public class AbstractQueuedLongSynchroni
721          Thread t1 = new Thread(new CheckedRunnable() {
722              public void realRun() throws InterruptedException {
723                  sync.acquire(1);
724 <                threadAssertTrue(sync.getWaitingThreads(c).isEmpty());
724 >                assertTrue(sync.getWaitingThreads(c).isEmpty());
725                  c.await();
726                  sync.release(1);
727              }});
# Line 727 | Line 729 | public class AbstractQueuedLongSynchroni
729          Thread t2 = new Thread(new CheckedRunnable() {
730              public void realRun() throws InterruptedException {
731                  sync.acquire(1);
732 <                threadAssertFalse(sync.getWaitingThreads(c).isEmpty());
732 >                assertFalse(sync.getWaitingThreads(c).isEmpty());
733                  c.await();
734                  sync.release(1);
735              }});
# Line 934 | Line 936 | public class AbstractQueuedLongSynchroni
936  
937          Thread t = new Thread(new CheckedRunnable() {
938              public void realRun() throws InterruptedException {
939 <                threadAssertFalse(l.isSignalled());
939 >                assertFalse(l.isSignalled());
940                  l.acquireSharedInterruptibly(0);
941 <                threadAssertTrue(l.isSignalled());
941 >                assertTrue(l.isSignalled());
942              }});
943  
944          t.start();
# Line 973 | Line 975 | public class AbstractQueuedLongSynchroni
975      /**
976       * acquireSharedInterruptibly throws IE if interrupted before released
977       */
978 <    public void testAcquireSharedInterruptibly_InterruptedException() throws InterruptedException {
978 >    public void testAcquireSharedInterruptibly_InterruptedException()
979 >        throws InterruptedException {
980          final BooleanLatch l = new BooleanLatch();
981          Thread t = new Thread(new CheckedInterruptedRunnable() {
982              public void realRun() throws InterruptedException {
983 <                threadAssertFalse(l.isSignalled());
983 >                assertFalse(l.isSignalled());
984                  l.acquireSharedInterruptibly(0);
985              }});
986  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines