--- jsr166/src/test/tck/SynchronousQueueTest.java 2010/08/25 00:07:03 1.21 +++ jsr166/src/test/tck/SynchronousQueueTest.java 2010/09/29 12:33:48 1.24 @@ -119,6 +119,7 @@ public class SynchronousQueueTest extend shouldThrow(); } catch (NullPointerException success) {} } + /** * addAll throws ISE if no active taker */ @@ -174,7 +175,7 @@ public class SynchronousQueueTest extend ++added; } } catch (InterruptedException success) { - assertTrue(added == 1); + assertEquals(1, added); } }}); @@ -251,7 +252,7 @@ public class SynchronousQueueTest extend ++added; } } catch (InterruptedException success) { - assertTrue(added == 1); + assertEquals(1, added); } }}); @@ -346,9 +347,9 @@ public class SynchronousQueueTest extend final SynchronousQueue q = new SynchronousQueue(); Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { - assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); - assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); try { + assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); + assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); q.poll(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} @@ -386,9 +387,9 @@ public class SynchronousQueueTest extend final SynchronousQueue q = new SynchronousQueue(true); Thread t = new Thread(new CheckedRunnable() { public void realRun() throws InterruptedException { - assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); - assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); try { + assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); + assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); q.poll(LONG_DELAY_MS, MILLISECONDS); threadShouldThrow(); } catch (InterruptedException success) {} @@ -716,9 +717,9 @@ public class SynchronousQueueTest extend ArrayList l = new ArrayList(); Thread.sleep(SHORT_DELAY_MS); q.drainTo(l, 1); - assertTrue(l.size() == 1); + assertEquals(1, l.size()); q.drainTo(l, 1); - assertTrue(l.size() == 2); + assertEquals(2, l.size()); assertTrue(l.contains(one)); assertTrue(l.contains(two)); t1.join();