Class CopyOnWriteArraySetTest

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

public class CopyOnWriteArraySetTest
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
CopyOnWriteArraySetTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testAdd2()
          add will not add the element if it already exists in the set
 void testAdd3()
          add adds the element when it does not exist in the set
 void testAddAll()
          addAll adds each element from the given collection
 void testAddAll2()
          addAll adds each element from the given collection that did not already exist in the set
 void testClear()
          clear removes all elements from the set
 void testConstructor()
          Default-constructed set is empty
 void testConstructor3()
          Collection-constructed set holds all of its elements
 void testContains()
          contains returns true for added elements
 void testContainsAll()
          containsAll returns true for collections with subset of elements
 void testEquals()
          Sets with equal elements are equal
 void testIsEmpty()
          isEmpty is true when empty, else false
 void testIterator()
          iterator() returns an iterator containing the elements of the set
 void testIteratorRemove()
          iterator remove is unsupported
 void testRemove()
          remove removes an element
 void testRemoveAll()
          removeAll removes all elements from the given collection
 void testSerialization()
          A deserialized serialized set is equal
 void testSize()
          size returns the number of elements
 void testToArray_ArrayStoreException()
          toArray throws an ArrayStoreException when the given array can not store the objects inside the set
 void testToArray()
          toArray returns an Object array containing all elements from the set
 void testToArray2()
          toArray returns an Integer array containing all elements from the set
 void testToString()
          toString holds toString of elements
 
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

CopyOnWriteArraySetTest

public CopyOnWriteArraySetTest()
Method Detail

main

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

suite

public static junit.framework.Test suite()

testConstructor

public void testConstructor()
Default-constructed set is empty


testConstructor3

public void testConstructor3()
Collection-constructed set holds all of its elements


testAddAll

public void testAddAll()
addAll adds each element from the given collection


testAddAll2

public void testAddAll2()
addAll adds each element from the given collection that did not already exist in the set


testAdd2

public void testAdd2()
add will not add the element if it already exists in the set


testAdd3

public void testAdd3()
add adds the element when it does not exist in the set


testClear

public void testClear()
clear removes all elements from the set


testContains

public void testContains()
contains returns true for added elements


testEquals

public void testEquals()
Sets with equal elements are equal


testContainsAll

public void testContainsAll()
containsAll returns true for collections with subset of elements


testIsEmpty

public void testIsEmpty()
isEmpty is true when empty, else false


testIterator

public void testIterator()
iterator() returns an iterator containing the elements of the set


testIteratorRemove

public void testIteratorRemove()
iterator remove is unsupported


testToString

public void testToString()
toString holds toString of elements


testRemoveAll

public void testRemoveAll()
removeAll removes all elements from the given collection


testRemove

public void testRemove()
remove removes an element


testSize

public void testSize()
size returns the number of elements


testToArray

public void testToArray()
toArray returns an Object array containing all elements from the set


testToArray2

public void testToArray2()
toArray returns an Integer array containing all elements from the set


testToArray_ArrayStoreException

public void testToArray_ArrayStoreException()
toArray throws an ArrayStoreException when the given array can not store the objects inside the set


testSerialization

public void testSerialization()
                       throws java.lang.Exception
A deserialized serialized set is equal

Throws:
java.lang.Exception