Search in sources :

Example 1 with MinimalCollection

use of com.google.common.collect.testing.MinimalCollection in project guava by google.

the class ForwardingCollectionTest method suite.

public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ForwardingCollectionTest.class);
    suite.addTest(CollectionTestSuiteBuilder.using(new TestStringCollectionGenerator() {

        @Override
        protected Collection<String> create(String[] elements) {
            return new StandardImplForwardingCollection<String>(Lists.newLinkedList(asList(elements)));
        }
    }).named("ForwardingCollection[LinkedList] with standard implementations").withFeatures(CollectionSize.ANY, CollectionFeature.ALLOWS_NULL_VALUES, CollectionFeature.GENERAL_PURPOSE).createTestSuite());
    suite.addTest(CollectionTestSuiteBuilder.using(new TestStringCollectionGenerator() {

        @Override
        protected Collection<String> create(String[] elements) {
            return new StandardImplForwardingCollection<String>(MinimalCollection.of(elements));
        }
    }).named("ForwardingCollection[MinimalCollection] with standard" + " implementations").withFeatures(CollectionSize.ANY, CollectionFeature.ALLOWS_NULL_VALUES).createTestSuite());
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) Collection(java.util.Collection) MinimalCollection(com.google.common.collect.testing.MinimalCollection) TestStringCollectionGenerator(com.google.common.collect.testing.TestStringCollectionGenerator)

Example 2 with MinimalCollection

use of com.google.common.collect.testing.MinimalCollection in project guava by hceylan.

the class ForwardingCollectionTest method suite.

public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ForwardingCollectionTest.class);
    suite.addTest(CollectionTestSuiteBuilder.using(new TestStringCollectionGenerator() {

        @Override
        protected Collection<String> create(String[] elements) {
            return new StandardImplForwardingCollection<String>(Lists.newLinkedList(asList(elements)));
        }
    }).named("ForwardingCollection[LinkedList] with standard implementations").withFeatures(CollectionSize.ANY, CollectionFeature.ALLOWS_NULL_VALUES, CollectionFeature.GENERAL_PURPOSE).createTestSuite());
    suite.addTest(CollectionTestSuiteBuilder.using(new TestStringCollectionGenerator() {

        @Override
        protected Collection<String> create(String[] elements) {
            return new StandardImplForwardingCollection<String>(MinimalCollection.of(elements));
        }
    }).named("ForwardingCollection[MinimalCollection] with standard" + " implementations").withFeatures(CollectionSize.ANY, CollectionFeature.ALLOWS_NULL_VALUES).createTestSuite());
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) Collection(java.util.Collection) MinimalCollection(com.google.common.collect.testing.MinimalCollection) TestStringCollectionGenerator(com.google.common.collect.testing.TestStringCollectionGenerator)

Aggregations

MinimalCollection (com.google.common.collect.testing.MinimalCollection)2 TestStringCollectionGenerator (com.google.common.collect.testing.TestStringCollectionGenerator)2 Collection (java.util.Collection)2 TestSuite (junit.framework.TestSuite)2