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

Comparing jsr166/src/test/tck/FutureTaskTest.java (file contents):
Revision 1.54 by jsr166, Sun Aug 11 22:29:26 2019 UTC vs.
Revision 1.56 by jsr166, Thu Sep 5 21:46:35 2019 UTC

# Line 720 | Line 720 | public class FutureTaskTest extends JSR1
720      /**
721       * get is interruptible
722       */
723 <    public void testGet_interruptible() {
723 >    public void testGet_Interruptible() {
724          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
725          final FutureTask task = new FutureTask(new NoOpCallable());
726          Thread t = newStartedThread(new CheckedRunnable() {
# Line 749 | Line 749 | public class FutureTaskTest extends JSR1
749      /**
750       * timed get is interruptible
751       */
752 <    public void testTimedGet_interruptible() {
752 >    public void testTimedGet_Interruptible() {
753          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
754          final FutureTask task = new FutureTask(new NoOpCallable());
755          Thread t = newStartedThread(new CheckedRunnable() {
756              public void realRun() throws Exception {
757                long startTime = System.nanoTime();
758
757                  Thread.currentThread().interrupt();
758                  try {
759                      task.get(randomTimeout(), randomTimeUnit());
# Line 765 | Line 763 | public class FutureTaskTest extends JSR1
763  
764                  pleaseInterrupt.countDown();
765                  try {
766 <                    task.get(LONG_DELAY_MS, MILLISECONDS);
766 >                    task.get(LONGER_DELAY_MS, MILLISECONDS);
767                      shouldThrow();
768                  } catch (InterruptedException success) {}
769                  assertFalse(Thread.interrupted());
772
773                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
770              }});
771  
772          await(pleaseInterrupt);
773 +        if (randomBoolean()) assertThreadBlocks(t, Thread.State.TIMED_WAITING);
774          t.interrupt();
775          awaitTermination(t);
776          checkNotDone(task);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines