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

Comparing jsr166/src/test/tck/SynchronousQueueTest.java (file contents):
Revision 1.49 by jsr166, Sun Oct 4 18:28:51 2015 UTC vs.
Revision 1.53 by jsr166, Sat May 13 21:52:59 2017 UTC

# Line 172 | Line 172 | public class SynchronousQueueTest extend
172          catch (InterruptedException e) { threadUnexpectedException(e); }
173  
174          await(pleaseInterrupt);
175 <        assertThreadStaysAlive(t);
175 >        assertThreadBlocks(t, Thread.State.WAITING);
176          t.interrupt();
177          awaitTermination(t);
178          assertEquals(0, q.remainingCapacity());
# Line 257 | Line 257 | public class SynchronousQueueTest extend
257                  pleaseOffer.countDown();
258                  startTime = System.nanoTime();
259                  assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
260                assertTrue(millisElapsedSince(startTime) < MEDIUM_DELAY_MS);
260  
261                  Thread.currentThread().interrupt();
262                  try {
# Line 272 | Line 271 | public class SynchronousQueueTest extend
271                      shouldThrow();
272                  } catch (InterruptedException success) {}
273                  assertFalse(Thread.interrupted());
274 +
275 +                assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
276              }});
277  
278          await(pleaseOffer);
279          long startTime = System.nanoTime();
280          try { assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); }
281          catch (InterruptedException e) { threadUnexpectedException(e); }
282 <        assertTrue(millisElapsedSince(startTime) < MEDIUM_DELAY_MS);
282 >        assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
283  
284          await(pleaseInterrupt);
285          assertThreadStaysAlive(t);
# Line 400 | Line 401 | public class SynchronousQueueTest extend
401      public void testToArray2()      { testToArray2(false); }
402      public void testToArray2_fair() { testToArray2(true); }
403      public void testToArray2(boolean fair) {
404 <        final SynchronousQueue<Integer> q
404 <            = new SynchronousQueue<Integer>(fair);
404 >        final SynchronousQueue<Integer> q = new SynchronousQueue<>(fair);
405          Integer[] a;
406  
407          a = new Integer[0];
# Line 569 | Line 569 | public class SynchronousQueueTest extend
569                  fail("timed out");
570              Thread.yield();
571          }
572 <        assertTrue(l.size() == 1);
572 >        assertEquals(1, l.size());
573          assertSame(one, l.get(0));
574          awaitTermination(t);
575      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines