public class LinkedTransferQueueTest extends 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
eight, expensiveTests, five, four, JAVA_CLASS_VERSION, JAVA_SPECIFICATION_VERSION, 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, testImplementationDetails, three, two, zero
Constructor and Description |
---|
LinkedTransferQueueTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAddAll3()
addAll of a collection with any null elements throws
NullPointerException after possibly adding some elements
|
void |
testAddAll5()
Queue contains all elements, in traversal order, of successful addAll
|
void |
testAddAllSelf()
addAll(this) throws IllegalArgumentException
|
void |
testBlockingTake()
take removes existing elements until empty, then blocks interruptibly
|
void |
testClear()
clear removes all elements
|
void |
testConstructor1()
Constructor builds new queue with size being zero and empty
being true
|
void |
testConstructor2()
Initializing constructor with null collection throws
NullPointerException
|
void |
testConstructor3()
Initializing from Collection of null elements throws
NullPointerException
|
void |
testConstructor4()
Initializing constructor with a collection containing some null elements
throws NullPointerException
|
void |
testConstructor5()
Queue contains all elements of the collection it is initialized by
|
void |
testContains()
contains(x) reports true when elements added but not yet removed
|
void |
testContainsAll()
containsAll(c) is true when c contains a subset of elements
|
void |
testDrainTo()
drainTo(c) empties queue into another collection c
|
void |
testDrainToN()
drainTo(c, n) empties first min(n, size) elements of queue into c
|
void |
testDrainToWithActivePut()
drainTo(c) empties full queue, unblocking a waiting put.
|
void |
testElement()
element returns next element, or throws NoSuchElementException if empty
|
void |
testEmptyIterator()
iterator of empty collection has no elements
|
void |
testInterruptedTimedPoll()
Interrupted timed poll throws InterruptedException instead of
returning timeout status
|
void |
testIterator()
iterator iterates through all elements
|
void |
testIteratorOrdering()
iterator ordering is FIFO
|
void |
testIteratorRemove()
iterator.remove() removes current element
|
void |
testNeverContainsNull()
remove(null), contains(null) always return false
|
void |
testOfferInExecutor()
offer transfers elements across Executor tasks
|
void |
testPeek()
peek returns next element, or null if empty
|
void |
testPoll()
poll succeeds unless empty
|
void |
testPollInExecutor()
timed poll retrieves elements across Executor threads
|
void |
testPut()
all elements successfully put are contained
|
void |
testRemainingCapacity()
remainingCapacity() always returns Integer.MAX_VALUE
|
void |
testRemove()
remove removes next element, or throws NoSuchElementException if empty
|
void |
testRemoveAll()
removeAll(c) removes only those elements of c and reports true
if changed
|
void |
testRemoveElementAndAdd()
An add following remove(x) succeeds
|
void |
testRetainAll()
retainAll(c) retains only those elements of c and reports true
if changed
|
void |
testSerialization()
A deserialized serialized queue has same elements in same order
|
void |
testTake()
take retrieves elements in FIFO order
|
void |
testTimedPoll()
timed poll with nonzero timeout succeeds when non-empty, else times out
|
void |
testTimedPoll0()
timed poll with zero timeout succeeds when non-empty, else times out
|
void |
testTimedPollAfterInterrupt()
timed poll after thread interrupted throws InterruptedException
instead of returning timeout status
|
void |
testToArray()
toArray() contains all elements in FIFO order
|
void |
testToArray1_BadArg()
toArray(incompatible array type) throws ArrayStoreException
|
void |
testToArray2()
toArray(a) contains all elements in FIFO order
|
void |
testToString()
toString contains toStrings of elements
|
void |
testTransfer1()
transfer(null) throws NullPointerException
|
void |
testTransfer2()
transfer waits until a poll occurs.
|
void |
testTransfer3()
transfer waits until a poll occurs, and then transfers in fifo order
|
void |
testTransfer4()
transfer waits until a poll occurs, at which point the polling
thread returns the element
|
void |
testTransfer5()
transfer waits until a take occurs.
|
void |
testTryTransfer1()
tryTransfer(null) throws NullPointerException
|
void |
testTryTransfer2()
tryTransfer returns false and does not enqueue if there are no
consumers waiting to poll or take.
|
void |
testTryTransfer3()
If there is a consumer waiting in timed poll, tryTransfer
returns true while successfully transfering object.
|
void |
testTryTransfer4()
If there is a consumer waiting in take, tryTransfer returns
true while successfully transfering object.
|
void |
testTryTransfer5()
tryTransfer blocks interruptibly if no takers
|
void |
testTryTransfer6()
tryTransfer gives up after the timeout and returns false
|
void |
testTryTransfer7()
tryTransfer waits for any elements previously in to be removed
before transfering to a poll or take
|
void |
testTryTransfer8()
tryTransfer attempts to enqueue into the queue and fails
returning false not enqueueing and the successive poll is null
|
void |
testWaitingConsumer()
timed poll() or take() increments the waiting consumer count;
offer(e) decrements the waiting consumer count
|
void |
testWeaklyConsistentIteration()
Modifications do not cause iterators to fail
|
addNamedTestClasses, assertIteratorExhausted, assertThrows, atLeastJava10, atLeastJava6, atLeastJava7, atLeastJava8, atLeastJava9, await, await, await, awaiter, countDowner, getShortDelay, jdk8ParameterizedTestSuite, latchAwaitingStringTask, newTestSuite, parameterizedTestSuite, permissivePolicy, possiblyInterruptedRunnable, runBare, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, runWithSecurityManagerWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, testMethodNames, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
public void testConstructor1()
public void testConstructor2()
public void testConstructor3()
public void testConstructor4()
public void testConstructor5()
public void testRemainingCapacity()
public void testAddAllSelf()
public void testAddAll3()
public void testAddAll5()
public void testPut()
public void testTake() throws InterruptedException
InterruptedException
public void testBlockingTake() throws InterruptedException
InterruptedException
public void testPoll() throws InterruptedException
InterruptedException
public void testTimedPoll0() throws InterruptedException
InterruptedException
public void testTimedPoll() throws InterruptedException
InterruptedException
public void testInterruptedTimedPoll() throws InterruptedException
InterruptedException
public void testTimedPollAfterInterrupt() throws InterruptedException
InterruptedException
public void testPeek() throws InterruptedException
InterruptedException
public void testElement() throws InterruptedException
InterruptedException
public void testRemove() throws InterruptedException
InterruptedException
public void testRemoveElementAndAdd() throws InterruptedException
InterruptedException
public void testContains()
public void testClear() throws InterruptedException
InterruptedException
public void testContainsAll()
public void testRetainAll()
public void testRemoveAll()
public void testToArray()
public void testToArray2()
public void testToArray1_BadArg()
public void testIterator() throws InterruptedException
InterruptedException
public void testEmptyIterator()
public void testIteratorRemove()
public void testIteratorOrdering()
public void testWeaklyConsistentIteration()
public void testToString()
public void testOfferInExecutor()
public void testPollInExecutor()
public void testSerialization() throws Exception
Exception
public void testDrainTo()
public void testDrainToWithActivePut() throws InterruptedException
InterruptedException
public void testDrainToN()
public void testWaitingConsumer() throws InterruptedException
InterruptedException
public void testTransfer1() throws InterruptedException
InterruptedException
public void testTransfer2() throws InterruptedException
InterruptedException
public void testTransfer3() throws InterruptedException
InterruptedException
public void testTransfer4() throws InterruptedException
InterruptedException
public void testTransfer5() throws InterruptedException
InterruptedException
public void testTryTransfer1()
public void testTryTransfer2() throws InterruptedException
InterruptedException
public void testTryTransfer3() throws InterruptedException
InterruptedException
public void testTryTransfer4() throws InterruptedException
InterruptedException
public void testTryTransfer5() throws InterruptedException
InterruptedException
public void testTryTransfer6() throws InterruptedException
InterruptedException
public void testTryTransfer7() throws InterruptedException
InterruptedException
public void testTryTransfer8() throws InterruptedException
InterruptedException
public void testNeverContainsNull()