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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.269 by jsr166, Thu Sep 26 20:48:52 2019 UTC vs.
Revision 1.271 by jsr166, Sat Feb 1 18:52:17 2020 UTC

# Line 704 | Line 704 | public class JSR166TestCase extends Test
704      /**
705       * Returns a random element from given choices.
706       */
707 +    <T> T chooseRandomly(List<T> choices) {
708 +        return choices.get(ThreadLocalRandom.current().nextInt(choices.size()));
709 +    }
710 +
711 +    /**
712 +     * Returns a random element from given choices.
713 +     */
714      <T> T chooseRandomly(T... choices) {
715          return choices[ThreadLocalRandom.current().nextInt(choices.length)];
716      }
# Line 1193 | Line 1200 | public class JSR166TestCase extends Test
1200          } catch (TimeoutException success) {
1201          } catch (Exception fail) {
1202              threadUnexpectedException(fail);
1203 <        } finally { future.cancel(true); }
1203 >        }
1204          assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
1205 +        assertFalse(future.isDone());
1206      }
1207  
1208      /**
# Line 1772 | Line 1780 | public class JSR166TestCase extends Test
1780  
1781          public int await() {
1782              try {
1783 <                return super.await(2 * LONG_DELAY_MS, MILLISECONDS);
1783 >                return super.await(LONGER_DELAY_MS, MILLISECONDS);
1784              } catch (TimeoutException timedOut) {
1785                  throw new AssertionError("timed out");
1786              } catch (Exception fail) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines