Class ConcurrentLinkedDequeTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by JSR166TestCase
              extended by ConcurrentLinkedDequeTest
All Implemented Interfaces:
junit.framework.Test

public class ConcurrentLinkedDequeTest
extends JSR166TestCase


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
ConcurrentLinkedDequeTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testAdd()
          add(x) succeeds
 void testAddAll1()
          addAll(null) throws NPE
 void testAddAll2()
          addAll of a collection with null elements throws NPE
 void testAddAll3()
          addAll of a collection with any null elements throws NPE after possibly adding some elements
 void testAddAll5()
          Deque contains all elements, in traversal order, of successful addAll
 void testAddAllSelf()
          addAll(this) throws IAE
 void testAddFirst()
          addFirst(x) succeeds
 void testAddFirstNull()
          addFirst(null) throws NPE
 void testAddLast()
          addLast(x) succeeds
 void testAddLastNull()
          addLast(null) throws NPE
 void testAddNull()
          add(null) throws NPE
 void testClear()
          clear() removes all elements
 void testConstructor1()
          new deque is empty
 void testConstructor3()
          Initializing from null Collection throws NPE
 void testConstructor4()
          Initializing from Collection of null elements throws NPE
 void testConstructor5()
          Initializing from Collection with some null elements throws NPE
 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 testElement()
          element() returns first element, or throws NSEE if empty
 void testEmpty()
          isEmpty is true before add, false after
 void testFirstElement()
          getFirst() returns first element, or throws NSEE if empty
 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 testOffer()
          offer(x) succeeds
 void testOfferFirst()
          offerFirst(x) succeeds
 void testOfferFirstNull()
          offerFirst(null) throws NPE
 void testOfferLast()
          offerLast(x) succeeds
 void testOfferLastNull()
          offerLast(null) throws NPE
 void testOfferNull()
          offer(null) throws NPE
 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 testPollLast()
          pollLast() succeeds unless empty
 void testPop()
          pop() removes first element, or throws NSEE if empty
 void testPush()
          peekFirst() returns element inserted with push
 void testPushNull()
          push(null) throws NPE
 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 testRemoveElement()
          remove(x) removes x and returns true if present
 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 change
 void testSerialization()
          A deserialized serialized deque has same elements in same order
 void testSize()
          size() changes when elements added and removed
 void testToArray_NullArg()
          toArray(null) throws NullPointerException
 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
 
Methods inherited from class JSR166TestCase
assertThreadJoinTimesOut, awaiter, checkEmpty, delay, getShortDelay, joinPool, latchAwaitingStringTask, newTestSuite, permissivePolicy, possiblyInterruptedRunnable, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, 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

ConcurrentLinkedDequeTest

public ConcurrentLinkedDequeTest()
Method Detail

main

public static void main(java.lang.String[] args)

suite

public static junit.framework.Test suite()

testConstructor1

public void testConstructor1()
new deque is empty


testConstructor3

public void testConstructor3()
Initializing from null Collection throws NPE


testConstructor4

public void testConstructor4()
Initializing from Collection of null elements throws NPE


testConstructor5

public void testConstructor5()
Initializing from Collection with some null elements throws NPE


testConstructor6

public void testConstructor6()
Deque contains all elements of collection used to initialize


testEmpty

public void testEmpty()
isEmpty is true before add, false after


testSize

public void testSize()
size() changes when elements added and removed


testPushNull

public void testPushNull()
push(null) throws NPE


testPush

public void testPush()
peekFirst() returns element inserted with push


testPop

public void testPop()
pop() removes first element, or throws NSEE if empty


testOfferNull

public void testOfferNull()
offer(null) throws NPE


testOfferFirstNull

public void testOfferFirstNull()
offerFirst(null) throws NPE


testOfferLastNull

public void testOfferLastNull()
offerLast(null) throws NPE


testOffer

public void testOffer()
offer(x) succeeds


testOfferFirst

public void testOfferFirst()
offerFirst(x) succeeds


testOfferLast

public void testOfferLast()
offerLast(x) succeeds


testAddNull

public void testAddNull()
add(null) throws NPE


testAddFirstNull

public void testAddFirstNull()
addFirst(null) throws NPE


testAddLastNull

public void testAddLastNull()
addLast(null) throws NPE


testAdd

public void testAdd()
add(x) succeeds


testAddFirst

public void testAddFirst()
addFirst(x) succeeds


testAddLast

public void testAddLast()
addLast(x) succeeds


testAddAll1

public void testAddAll1()
addAll(null) throws NPE


testAddAllSelf

public void testAddAllSelf()
addAll(this) throws IAE


testAddAll2

public void testAddAll2()
addAll of a collection with null elements throws NPE


testAddAll3

public void testAddAll3()
addAll of a collection with any null elements throws NPE after possibly adding some elements


testAddAll5

public void testAddAll5()
Deque contains all elements, in traversal order, of successful addAll


testPollFirst

public void testPollFirst()
pollFirst() succeeds unless empty


testPollLast

public void testPollLast()
pollLast() succeeds unless empty


testPoll

public void testPoll()
poll() succeeds unless empty


testPeek

public void testPeek()
peek() returns next element, or null if empty


testElement

public void testElement()
element() returns first element, or throws NSEE if empty


testRemove

public void testRemove()
remove() removes next element, or throws NSEE if empty


testRemoveElement

public void testRemoveElement()
remove(x) removes x and returns true if present


testPeekFirst

public void testPeekFirst()
peekFirst() returns next element, or null if empty


testPeekLast

public void testPeekLast()
peekLast() returns next element, or null if empty


testFirstElement

public void testFirstElement()
getFirst() returns first element, or throws NSEE if empty


testLastElement

public void testLastElement()
getLast() returns last element, or throws NSEE if empty


testRemoveFirst

public void testRemoveFirst()
removeFirst() removes first element, or throws NSEE if empty


testRemoveLast

public void testRemoveLast()
removeLast() removes last element, or throws NSEE if empty


testRemoveFirstOccurrence

public void testRemoveFirstOccurrence()
removeFirstOccurrence(x) removes x and returns true if present


testRemoveLastOccurrence

public void testRemoveLastOccurrence()
removeLastOccurrence(x) removes x and returns true if present


testContains

public void testContains()
contains(x) reports true when elements added but not yet removed


testClear

public void testClear()
clear() removes all elements


testContainsAll

public void testContainsAll()
containsAll(c) is true when c contains a subset of elements


testRetainAll

public void testRetainAll()
retainAll(c) retains only those elements of c and reports true if change


testRemoveAll

public void testRemoveAll()
removeAll(c) removes only those elements of c and reports true if changed


testToArray

public void testToArray()
toArray() contains all elements in FIFO order


testToArray2

public void testToArray2()
toArray(a) contains all elements in FIFO order


testToArray_NullArg

public void testToArray_NullArg()
toArray(null) throws NullPointerException


testToArray1_BadArg

public void testToArray1_BadArg()
toArray(incompatible array type) throws ArrayStoreException


testIterator

public void testIterator()
Iterator iterates through all elements


testIteratorOrdering

public void testIteratorOrdering()
Iterator ordering is FIFO


testWeaklyConsistentIteration

public void testWeaklyConsistentIteration()
Modifications do not cause iterators to fail


testIteratorRemove

public void testIteratorRemove()
iterator.remove() removes current element


testDescendingIterator

public void testDescendingIterator()
Descending iterator iterates through all elements


testDescendingIteratorOrdering

public void testDescendingIteratorOrdering()
Descending iterator ordering is reverse FIFO


testDescendingIteratorRemove

public void testDescendingIteratorRemove()
descendingIterator.remove() removes current element


testToString

public void testToString()
toString() contains toStrings of elements


testSerialization

public void testSerialization()
                       throws java.lang.Exception
A deserialized serialized deque has same elements in same order

Throws:
java.lang.Exception