@CheckReturnValue
Package com.google.common.collect.testing
-
Interface Summary Interface Description DerivedGenerator A generator that relies on a preexisting generator for most of its work.OneSizeTestContainerGenerator<T,E> The subject-generator interface accepted by Collection testers, for testing a Collection at one particularCollectionSize
.SpliteratorTester.Ordered Return type from "contains the following elements" assertions.TestCollectionGenerator<E> Creates collections, containing sample elements, to be tested.TestContainerGenerator<T,E> To be implemented by test generators of things that can contain elements.TestIteratorGenerator<E> Creates iterators to be tested.TestListGenerator<E> Creates sets, containing sample elements, to be tested.TestMapGenerator<K,V> Creates maps, containing sample elements, to be tested.TestQueueGenerator<E> Creates queues, containing sample elements, to be tested.TestSetGenerator<E> Creates sets, containing sample elements, to be tested.TestSortedMapGenerator<K,V> Creates sorted maps, containing sample elements, to be tested.TestSortedSetGenerator<E> Creates sorted sets, containing sample elements, to be tested.TestSubjectGenerator<T> To be implemented by test generators that can produce test subjects without requiring any parameters. -
Class Summary Class Description AbstractCollectionTester<E> Base class for collection testers.AbstractCollectionTestSuiteBuilder<B extends AbstractCollectionTestSuiteBuilder<B,E>,E> Abstract superclass of all test-suite builders for collection interfaces.AbstractContainerTester<C,E> Base class for testers of classes (includingCollection
andMap
) that contain elements.AbstractContainerTester.ArrayWithDuplicate<E> AbstractMapTester<K,V> Base class for map testers.AbstractTester<G> This abstract base class for testers allows the framework to inject needed information after JUnit constructs the instances.BaseComparable Simple base class to verify that we handle generics correctly.CollectionTestSuiteBuilder<E> Concrete instantiation ofAbstractCollectionTestSuiteBuilder
for testing collections that do not have a more specific tester likeListTestSuiteBuilder
orSetTestSuiteBuilder
.ConcurrentMapTestSuiteBuilder<K,V> Creates, based on your criteria, a JUnit test suite that exhaustively tests a ConcurrentMap implementation.ConcurrentNavigableMapTestSuiteBuilder<K,V> Creates, based on your criteria, a JUnit test suite that exhaustively tests a ConcurrentNavigableMap implementation.DerivedCollectionGenerators Derived suite generators, split out of the suite builders so that they are available to GWT.DerivedCollectionGenerators.MapEntrySetGenerator<K,V> DerivedCollectionGenerators.MapKeySetGenerator<K,V> DerivedCollectionGenerators.MapSortedKeySetGenerator<K,V> DerivedCollectionGenerators.MapValueCollectionGenerator<K,V> DerivedCollectionGenerators.SortedMapSubmapTestMapGenerator<K,V> DerivedCollectionGenerators.SortedSetSubsetTestSetGenerator<E> DerivedComparable Simple derived class to verify that we handle generics correctly.DerivedTestIteratorGenerator<E> Adapts a test iterable generator to give a TestIteratorGenerator.FeatureSpecificTestSuiteBuilder<B extends FeatureSpecificTestSuiteBuilder<B,G>,G> Creates, based on your criteria, a JUnit test suite that exhaustively tests the object generated by a G, selecting appropriate tests by matching them against specified features.Helpers Helpers.NullsBefore Compares strings in natural order except that null comes immediately before a given value.Helpers.NullsBeforeB Helpers.NullsBeforeTwo IteratorTester<E> A utility for testing an Iterator implementation by comparing its behavior to that of a "known good" reference implementation.ListIteratorTester<E> A utility similar toIteratorTester
for testing aListIterator
against a known good reference implementation.ListTestSuiteBuilder<E> Creates, based on your criteria, a JUnit test suite that exhaustively tests a List implementation.MapInterfaceTest<K,V> Tests representing the contract ofMap
.MapTestSuiteBuilder<K,V> Creates, based on your criteria, a JUnit test suite that exhaustively tests a Map implementation.MinimalCollection<E> A simplistic collection which implements only the bare minimum allowed by the spec, and throws exceptions whenever it can.MinimalIterable<E> An implementation ofIterable
which throws an exception on all invocations of theMinimalIterable.iterator()
method after the first, and whose iterator is always unmodifiable.MinimalSet<E> A simplistic set which implements the bare minimum so that it can be used in tests without relying on any specific Set implementations.NavigableMapTestSuiteBuilder<K,V> Creates, based on your criteria, a JUnit test suite that exhaustively tests a NavigableMap implementation.NavigableMapTestSuiteBuilder.NavigableMapSubmapTestMapGenerator<K,V> NavigableSetTestSuiteBuilder<E> Creates, based on your criteria, a JUnit test suite that exhaustively tests a NavigableSet implementation.NavigableSetTestSuiteBuilder.NavigableSetSubsetTestSetGenerator<E> OneSizeGenerator<T,E> Generator for collection of a particular size.PerCollectionSizeTestSuiteBuilder<B extends PerCollectionSizeTestSuiteBuilder<B,G,T,E>,G extends TestContainerGenerator<T,E>,T,E> This builder creates a composite test suite, containing a separate test suite for eachCollectionSize
present in the features specified byFeatureSpecificTestSuiteBuilder.withFeatures(Feature...)
.QueueTestSuiteBuilder<E> Creates, based on your criteria, a JUnit test suite that exhaustively tests a queue implementation.ReserializingTestCollectionGenerator<E> Reserializes the sets created by another test set generator.ReserializingTestSetGenerator<E> Reserializes the sets created by another test set generator.SafeTreeMap<K,V> A wrapper aroundTreeMap
that aggressively checks to see if keys are mutually comparable.SafeTreeSet<E> A wrapper aroundTreeSet
that aggressively checks to see if elements are mutually comparable.SampleElements<E> A container class for the five sample elements we need for testing.SampleElements.Chars SampleElements.Colliders SampleElements.Enums SampleElements.Ints SampleElements.Strings SampleElements.Unhashables SetTestSuiteBuilder<E> Creates, based on your criteria, a JUnit test suite that exhaustively tests a Set implementation.SortedMapInterfaceTest<K,V> Tests representing the contract ofSortedMap
.SortedMapTestSuiteBuilder<K,V> Creates, based on your criteria, a JUnit test suite that exhaustively tests a SortedMap implementation.SortedSetTestSuiteBuilder<E> Creates, based on your criteria, a JUnit test suite that exhaustively tests a SortedSet implementation.SpliteratorTester<E> Tester forSpliterator
implementations.TestCharacterListGenerator GeneratesList<Character>
instances for test suites.TestCollidingSetGenerator A generator using sample elements whose hash codes all collide badly.TestEnumMapGenerator Implementation helper forTestMapGenerator
for use with enum maps.TestEnumSetGenerator An abstract TestSetGenerator for generating sets containing enum values.TestIntegerSetGenerator Create integer sets for collection tests.TestIntegerSortedSetGenerator Create integer sets for testing collections that are sorted by natural ordering.TestMapEntrySetGenerator<K,V> Creates map entries using sample keys and sample values.TestsForListsInJavaUtil TestsForMapsInJavaUtil TestsForQueuesInJavaUtil TestsForSetsInJavaUtil TestStringCollectionGenerator String creation for testing arbitrary collections.TestStringListGenerator TODO: javadoc.TestStringMapGenerator Implementation helper forTestMapGenerator
for use with maps of strings.TestStringQueueGenerator Create queue of strings for tests.TestStringSetGenerator Create string sets for collection tests.TestStringSortedMapGenerator Implementation helper forTestMapGenerator
for use with sorted maps of strings.TestStringSortedSetGenerator Create string sets for testing collections that are sorted by natural ordering.TestUnhashableCollectionGenerator<T extends Collection<UnhashableObject>> Creates collections containing unhashable sample elements, to be tested.UnhashableObject An unhashable object to be used in testing as values in our collections. -
Enum Summary Enum Description AnEnum A sample enumerated type we use for testing.DerivedCollectionGenerators.Bound Two bounds (from and to) define how to build a subMap.IteratorFeature A method supported by implementations of theIterator
orListIterator
interface.WrongType A type which will never be used as the element type of any collection in our tests, and so can be used to test how a Collection behaves when given input of the wrong type.