com.google.common.collect.testing.testers
Class CollectionToArrayTester<E>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.common.collect.testing.AbstractTester<OneSizeTestContainerGenerator<C,E>>
              extended by com.google.common.collect.testing.AbstractContainerTester<Collection<E>,E>
                  extended by com.google.common.collect.testing.AbstractCollectionTester<E>
                      extended by com.google.common.collect.testing.testers.CollectionToArrayTester<E>
All Implemented Interfaces:
junit.framework.Test

public class CollectionToArrayTester<E>
extends AbstractCollectionTester<E>

A generic JUnit test which tests toArray() operations on a collection. Can't be invoked directly; please see CollectionTestSuiteBuilder.

This class is GWT compatible.

Author:
Kevin Bourrillion, Chris Povirk

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.common.collect.testing.AbstractContainerTester
AbstractContainerTester.ArrayWithDuplicate<E>
 
Field Summary
 
Fields inherited from class com.google.common.collect.testing.AbstractCollectionTester
collection
 
Fields inherited from class com.google.common.collect.testing.AbstractContainerTester
container, samples
 
Constructor Summary
CollectionToArrayTester()
           
 
Method Summary
static Method getToArrayIsPlainObjectArrayMethod()
          Returns the Method instance for testToArray_isPlainObjectArray() so that tests of Arrays.asList(Object[]) can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug 6260652 is fixed.
 void testToArray_emptyArray_ordered()
           
 void testToArray_emptyArray()
           
 void testToArray_emptyArrayOfObject()
           
 void testToArray_emptyArrayOfWrongTypeForEmptyCollection()
           
 void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection()
           
 void testToArray_isPlainObjectArray()
          Collection.toArray(Object[]) says: "Note that toArray(new Object[0]) is identical in function to toArray()."
 void testToArray_noArgs()
           
 void testToArray_oversizedArray_ordered()
           
 void testToArray_oversizedArray()
           
 void testToArray_rightSizedArray_ordered()
           
 void testToArray_rightSizedArray()
           
 void testToArray_rightSizedArrayOfObject_ordered()
           
 void testToArray_rightSizedArrayOfObject()
           
 
Methods inherited from class com.google.common.collect.testing.AbstractCollectionTester
actualContents, createArrayWithNullElement, expectNullMissingWhenNullUnsupported, initCollectionWithNullElement, resetCollection, resetContainer
 
Methods inherited from class com.google.common.collect.testing.AbstractContainerTester
createArrayWithDuplicateElement, createDisjointCollection, createSamplesArray, emptyCollection, expectAdded, expectAdded, expectAdded, expectContents, expectContents, expectMissing, expectUnchanged, getNullLocation, getNumElements, getOrderedElements, getSampleElements, getSampleElements, resetContainer, setUp
 
Methods inherited from class com.google.common.collect.testing.AbstractTester
getName, getSubjectGenerator, getTestMethodName, init, init, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, run, run, runBare, runTest, 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

CollectionToArrayTester

public CollectionToArrayTester()
Method Detail

testToArray_noArgs

public void testToArray_noArgs()

testToArray_isPlainObjectArray

public void testToArray_isPlainObjectArray()
Collection.toArray(Object[]) says: "Note that toArray(new Object[0]) is identical in function to toArray()."

For maximum effect, the collection under test should be created from an element array of a type other than Object[].


testToArray_emptyArray

public void testToArray_emptyArray()

testToArray_emptyArray_ordered

public void testToArray_emptyArray_ordered()

testToArray_emptyArrayOfObject

public void testToArray_emptyArrayOfObject()

testToArray_rightSizedArray

public void testToArray_rightSizedArray()

testToArray_rightSizedArray_ordered

public void testToArray_rightSizedArray_ordered()

testToArray_rightSizedArrayOfObject

public void testToArray_rightSizedArrayOfObject()

testToArray_rightSizedArrayOfObject_ordered

public void testToArray_rightSizedArrayOfObject_ordered()

testToArray_oversizedArray

public void testToArray_oversizedArray()

testToArray_oversizedArray_ordered

public void testToArray_oversizedArray_ordered()

testToArray_emptyArrayOfWrongTypeForNonEmptyCollection

public void testToArray_emptyArrayOfWrongTypeForNonEmptyCollection()

testToArray_emptyArrayOfWrongTypeForEmptyCollection

public void testToArray_emptyArrayOfWrongTypeForEmptyCollection()

getToArrayIsPlainObjectArrayMethod

public static Method getToArrayIsPlainObjectArrayMethod()
Returns the Method instance for testToArray_isPlainObjectArray() so that tests of Arrays.asList(Object[]) can suppress it with FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug 6260652 is fixed.



Copyright © 2010-2012. All Rights Reserved.