Class BlockingQueueTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by JSR166TestCase
              extended by BlockingQueueTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ArrayBlockingQueueTest.Fair, ArrayBlockingQueueTest.NonFair, LinkedBlockingDequeTest.Bounded, LinkedBlockingDequeTest.Unbounded, LinkedBlockingQueueTest.Bounded, LinkedBlockingQueueTest.Unbounded, LinkedTransferQueueTest.Generic, PriorityBlockingQueueTest.Generic, PriorityBlockingQueueTest.InitialCapacity, SynchronousQueueTest.Fair, SynchronousQueueTest.NonFair

public abstract class BlockingQueueTest
extends JSR166TestCase

Contains tests generally applicable to BlockingQueue implementations.


Nested Class Summary
 
Nested classes/interfaces inherited from class JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
 
Field Summary
 
Fields inherited from class JSR166TestCase
eight, expensiveTests, five, four, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, three, two, zero
 
Constructor Summary
BlockingQueueTest()
           
 
Method Summary
protected abstract  java.util.concurrent.BlockingQueue emptyCollection()
          Returns an empty instance of the implementation class.
 junit.framework.Test testSuite()
          Like suite(), but non-static
 void testTakeFromEmptyAfterInterrupt()
          take() throws InterruptedException immediately if interrupted before waiting
 void testTakeFromEmptyBlocksInterruptibly()
          take() blocks interruptibly when empty
 void testTimedPollWithOffer()
          timed poll before a delayed offer fails; after offer succeeds; on interruption throws
 void XXXXtestFails()
          For debugging.
 
Methods inherited from class JSR166TestCase
assertThreadJoinTimesOut, awaiter, checkEmpty, delay, getShortDelay, joinPool, latchAwaitingStringTask, main, newTestSuite, permissivePolicy, possiblyInterruptedRunnable, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, suite, tearDown, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockingQueueTest

public BlockingQueueTest()
Method Detail

testSuite

public junit.framework.Test testSuite()
Like suite(), but non-static


emptyCollection

protected abstract java.util.concurrent.BlockingQueue emptyCollection()
Returns an empty instance of the implementation class.


testTimedPollWithOffer

public void testTimedPollWithOffer()
                            throws java.lang.InterruptedException
timed poll before a delayed offer fails; after offer succeeds; on interruption throws

Throws:
java.lang.InterruptedException

testTakeFromEmptyBlocksInterruptibly

public void testTakeFromEmptyBlocksInterruptibly()
                                          throws java.lang.InterruptedException
take() blocks interruptibly when empty

Throws:
java.lang.InterruptedException

testTakeFromEmptyAfterInterrupt

public void testTakeFromEmptyAfterInterrupt()
                                     throws java.lang.InterruptedException
take() throws InterruptedException immediately if interrupted before waiting

Throws:
java.lang.InterruptedException

XXXXtestFails

public void XXXXtestFails()
For debugging.