public class LinkedBlockingDequeTest extends JSR166TestCase
Modifier and Type | Class and Description |
---|---|
static class |
LinkedBlockingDequeTest.Bounded |
static class |
LinkedBlockingDequeTest.Unbounded |
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 |
---|
LinkedBlockingDequeTest() |
Modifier and Type | Method and Description |
---|---|
void |
testAdd()
add succeeds if not full; throws ISE if full
|
void |
testAddAll3()
addAll of a collection with any null elements throws NPE after
possibly adding some elements
|
void |
testAddAll4()
addAll throws IllegalStateException if not enough room
|
void |
testAddAll5()
Deque contains all elements, in traversal order, of successful addAll
|
void |
testAddAllSelf()
addAll(this) throws IAE
|
void |
testAddFirst()
peekFirst returns element inserted with addFirst
|
void |
testAddLast()
peekLast returns element inserted with addLast
|
void |
testBlockingPut()
put blocks interruptibly if full
|
void |
testBlockingPutFirst()
putFirst blocks interruptibly if full
|
void |
testBlockingPutLast()
putLast blocks interruptibly if full
|
void |
testBlockingTake()
take removes existing elements until empty, then blocks interruptibly
|
void |
testBlockingTakeFirst()
takeFirst removes existing elements until empty, then blocks interruptibly
|
void |
testBlockingTakeLast()
takeLast removes existing elements until empty, then blocks interruptibly
|
void |
testClear()
clear removes all elements
|
void |
testConstructor1()
A new deque has the indicated capacity, or Integer.MAX_VALUE if
none given
|
void |
testConstructor2()
Constructor throws IllegalArgumentException if capacity argument nonpositive
|
void |
testConstructor3()
Initializing from null Collection throws NullPointerException
|
void |
testConstructor4()
Initializing from Collection of null elements throws NullPointerException
|
void |
testConstructor5()
Initializing from Collection with some null elements throws
NullPointerException
|
void |
testConstructor6()
Deque contains all elements of collection used to initialize
|
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 |
testDescendingIterator()
Descending iterator iterates through all elements
|
void |
testDescendingIteratorOrdering()
Descending iterator ordering is reverse FIFO
|
void |
testDescendingIteratorRemove()
descendingIterator.remove removes current element
|
void |
testDrainTo()
drainTo(c) empties deque into another collection c
|
void |
testDrainToN()
drainTo(c, n) empties first min(n, size) elements of queue into c
|
void |
testDrainToWithActivePut()
drainTo empties full deque, unblocking a waiting put.
|
void |
testElement()
element returns next element, or throws NSEE if empty
|
void |
testEmpty()
isEmpty is true before add, false after
|
void |
testEmptyFull()
Deque transitions from empty to full when elements added
|
void |
testEmptyIterator()
iterator of empty collection has no elements
|
void |
testFirstElement()
getFirst() returns first element, or throws NSEE if empty
|
void |
testInterruptedTimedPoll()
Interrupted timed poll throws InterruptedException instead of
returning timeout status
|
void |
testInterruptedTimedPollFirst()
Interrupted timed pollFirst throws InterruptedException instead of
returning timeout status
|
void |
testInterruptedTimedPollLast()
Interrupted timed pollLast 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 |
testLastElement()
getLast() returns last element, or throws NSEE if empty
|
void |
testNeverContainsNull()
remove(null), contains(null) always return false
|
void |
testOffer()
Offer succeeds if not full; fails if full
|
void |
testOfferFirst()
OfferFirst succeeds
|
void |
testOfferFirstNull()
offerFirst(null) throws NullPointerException
|
void |
testOfferInExecutor()
offer transfers elements across Executor tasks
|
void |
testOfferLast()
OfferLast succeeds
|
void |
testOfferLastNull()
offerLast(null) throws NullPointerException
|
void |
testPeek()
peek returns next element, or null if empty
|
void |
testPeekFirst()
peekFirst returns next element, or null if empty
|
void |
testPeekLast()
peekLast returns next element, or null if empty
|
void |
testPoll()
poll succeeds unless empty
|
void |
testPollFirst()
pollFirst succeeds unless empty
|
void |
testPollInExecutor()
timed poll retrieves elements across Executor threads
|
void |
testPollLast()
pollLast succeeds unless empty
|
void |
testPop()
pop removes next element, or throws NSEE if empty
|
void |
testPush()
push succeeds if not full; throws ISE if full
|
void |
testPushNull()
push(null) throws NPE
|
void |
testPushWithPeek()
peekFirst returns element inserted with push
|
void |
testPut()
all elements successfully put are contained
|
void |
testPutFirst()
all elements successfully putFirst are contained
|
void |
testPutFirstNull()
putFirst(null) throws NPE
|
void |
testPutFirstWithTake()
putFirst blocks interruptibly waiting for take when full
|
void |
testPutLast()
all elements successfully putLast are contained
|
void |
testPutLastNull()
putLast(null) throws NPE
|
void |
testPutLastWithTake()
putLast blocks interruptibly waiting for take when full
|
void |
testPutWithTake()
put blocks interruptibly waiting for take when full
|
void |
testRemainingCapacity()
remainingCapacity decreases on add, increases on remove
|
void |
testRemove()
remove removes next element, or throws NSEE if empty
|
void |
testRemoveAll()
removeAll(c) removes only those elements of c and reports true if changed
|
void |
testRemoveFirst()
removeFirst() removes first element, or throws NSEE if empty
|
void |
testRemoveFirstOccurrence()
removeFirstOccurrence(x) removes x and returns true if present
|
void |
testRemoveLast()
removeLast() removes last element, or throws NSEE if empty
|
void |
testRemoveLastOccurrence()
removeLastOccurrence(x) removes x and returns true if present
|
void |
testRetainAll()
retainAll(c) retains only those elements of c and reports true if changed
|
void |
testSerialization()
A deserialized serialized deque has same elements in same order
|
void |
testSize()
size changes when elements added and removed
|
void |
testTake()
take retrieves elements in FIFO order
|
void |
testTakeFirst()
take retrieves elements in FIFO order
|
void |
testTakeFirstFromEmptyAfterInterrupt()
takeFirst() throws InterruptedException immediately if interrupted
before waiting
|
void |
testTakeFirstFromEmptyBlocksInterruptibly()
takeFirst() blocks interruptibly when empty
|
void |
testTakeLast()
takeLast retrieves elements in FIFO order
|
void |
testTakeLastFromEmptyAfterInterrupt()
takeLast() throws InterruptedException immediately if interrupted
before waiting
|
void |
testTakeLastFromEmptyBlocksInterruptibly()
takeLast() blocks interruptibly when empty
|
void |
testTimedOffer()
timed offer times out if full and elements not taken
|
void |
testTimedOfferFirst()
timed offerFirst times out if full and elements not taken
|
void |
testTimedOfferLast()
timed offerLast times out if full and elements not taken
|
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 |
testTimedPollFirst()
timed pollFirst with nonzero timeout succeeds when non-empty, else times out
|
void |
testTimedPollFirst0()
timed pollFirst with zero timeout succeeds when non-empty, else times out
|
void |
testTimedPollFirstWithOfferFirst()
timed pollFirst before a delayed offerFirst fails; after offerFirst succeeds;
on interruption throws
|
void |
testTimedPollLast()
timed pollLast with nonzero timeout succeeds when non-empty, else times out
|
void |
testTimedPollLast0()
timed pollLast with zero timeout succeeds when non-empty, else times out
|
void |
testTimedPollWithOfferLast()
timed poll before a delayed offerLast fails; after offerLast succeeds;
on interruption throws
|
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 |
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 testEmpty()
public void testSize()
public void testOfferFirstNull()
public void testOfferLastNull()
public void testOfferFirst()
public void testOfferLast()
public void testPollFirst()
public void testPollLast()
public void testPeekFirst()
public void testPeek()
public void testPeekLast()
public void testFirstElement()
public void testLastElement()
public void testRemoveFirst()
public void testRemoveLast()
public void testRemove()
public void testRemoveFirstOccurrence()
public void testRemoveLastOccurrence()
public void testAddFirst()
public void testAddLast()
public void testConstructor1()
public void testConstructor2()
public void testConstructor3()
public void testConstructor4()
public void testConstructor5()
public void testConstructor6()
public void testEmptyFull()
public void testRemainingCapacity()
public void testPushNull()
public void testPush()
public void testPushWithPeek()
public void testPop()
public void testOffer()
public void testAdd()
public void testAddAllSelf()
public void testAddAll3()
public void testAddAll4()
public void testAddAll5()
public void testPut() throws InterruptedException
InterruptedException
public void testBlockingPut() throws InterruptedException
InterruptedException
public void testPutWithTake() throws InterruptedException
InterruptedException
public void testTimedOffer() throws InterruptedException
InterruptedException
public void testTake() throws InterruptedException
InterruptedException
public void testBlockingTake() throws InterruptedException
InterruptedException
public void testPoll()
public void testTimedPoll0() throws InterruptedException
InterruptedException
public void testTimedPoll() throws InterruptedException
InterruptedException
public void testInterruptedTimedPoll() throws InterruptedException
InterruptedException
public void testPutFirstNull() throws InterruptedException
InterruptedException
public void testPutFirst() throws InterruptedException
InterruptedException
public void testBlockingPutFirst() throws InterruptedException
InterruptedException
public void testPutFirstWithTake() throws InterruptedException
InterruptedException
public void testTimedOfferFirst() throws InterruptedException
InterruptedException
public void testTakeFirst() throws InterruptedException
InterruptedException
public void testTakeFirstFromEmptyBlocksInterruptibly()
public void testTakeFirstFromEmptyAfterInterrupt()
public void testTakeLastFromEmptyBlocksInterruptibly()
public void testTakeLastFromEmptyAfterInterrupt()
public void testBlockingTakeFirst() throws InterruptedException
InterruptedException
public void testTimedPollFirst0() throws InterruptedException
InterruptedException
public void testTimedPollFirst() throws InterruptedException
InterruptedException
public void testInterruptedTimedPollFirst() throws InterruptedException
InterruptedException
public void testTimedPollFirstWithOfferFirst() throws InterruptedException
InterruptedException
public void testPutLastNull() throws InterruptedException
InterruptedException
public void testPutLast() throws InterruptedException
InterruptedException
public void testBlockingPutLast() throws InterruptedException
InterruptedException
public void testPutLastWithTake() throws InterruptedException
InterruptedException
public void testTimedOfferLast() throws InterruptedException
InterruptedException
public void testTakeLast() throws InterruptedException
InterruptedException
public void testBlockingTakeLast() throws InterruptedException
InterruptedException
public void testTimedPollLast0() throws InterruptedException
InterruptedException
public void testTimedPollLast() throws InterruptedException
InterruptedException
public void testInterruptedTimedPollLast() throws InterruptedException
InterruptedException
public void testTimedPollWithOfferLast() throws InterruptedException
InterruptedException
public void testElement()
public void testContains()
public void testClear()
public void testContainsAll()
public void testRetainAll()
public void testRemoveAll()
public void testToArray() throws InterruptedException
InterruptedException
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 testDescendingIterator()
public void testDescendingIteratorOrdering()
public void testDescendingIteratorRemove()
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 testNeverContainsNull()