--- jsr166/src/test/tck/LinkedTransferQueueTest.java 2009/12/01 09:56:28 1.24 +++ jsr166/src/test/tck/LinkedTransferQueueTest.java 2010/10/06 07:49:22 1.25 @@ -24,12 +24,19 @@ import junit.framework.TestSuite; @SuppressWarnings({"unchecked", "rawtypes"}) public class LinkedTransferQueueTest extends JSR166TestCase { + public static class Generic extends BlockingQueueTest { + protected BlockingQueue emptyCollection() { + return new LinkedTransferQueue(); + } + } + public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { - return new TestSuite(LinkedTransferQueueTest.class); + return newTestSuite(LinkedTransferQueueTest.class, + new Generic().testSuite()); } void checkEmpty(LinkedTransferQueue q) throws InterruptedException { @@ -368,29 +375,6 @@ public class LinkedTransferQueueTest ext } /** - * timed poll before a delayed offer fails; after offer succeeds; - * on interruption throws - */ - public void testTimedPollWithOffer() throws InterruptedException { - final LinkedTransferQueue q = new LinkedTransferQueue(); - 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 { - q.poll(LONG_DELAY_MS, MILLISECONDS); - shouldThrow(); - } catch (InterruptedException success) {} - }}); - - t.start(); - Thread.sleep(SMALL_DELAY_MS); - assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS)); - t.interrupt(); - t.join(); - } - - /** * peek returns next element, or null if empty */ public void testPeek() throws InterruptedException {