Search in sources :

Example 36 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class FluentIterableTest method testNullPointerExceptions.

// NullPointerTester
@GwtIncompatible
public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(FluentIterable.class);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 37 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class EnumHashBiMapTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(BiMapTestSuiteBuilder.using(new EnumHashBiMapGenerator()).named("EnumHashBiMap").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.SUPPORTS_ITERATOR_REMOVE, MapFeature.ALLOWS_NULL_VALUES, MapFeature.GENERAL_PURPOSE, CollectionFeature.KNOWN_ORDER).createTestSuite());
    suite.addTestSuite(EnumHashBiMapTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 38 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ListsImplTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(createExampleSuite(new ArrayListExample("ArrayList")));
    suite.addTest(createExampleSuite(new LinkedListExample("LinkedList")));
    suite.addTest(createExampleSuite(new ArraysAsListExample("Arrays.asList")));
    suite.addTest(createExampleSuite(new ImmutableListExample("ImmutableList")));
    suite.addTest(createExampleSuite(new CopyOnWriteListExample("CopyOnWriteArrayList")));
    suite.addTestSuite(ListsImplTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 39 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ImmutableMultisetTest method suite.

// suite // TODO(cpovirk): add to collect/gwt/suites
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ImmutableMultisetTest.class);
    suite.addTestSuite(FloodingTest.class);
    suite.addTest(MultisetTestSuiteBuilder.using(new TestStringMultisetGenerator() {

        @Override
        protected Multiset<String> create(String[] elements) {
            return ImmutableMultiset.copyOf(elements);
        }
    }).named("ImmutableMultiset").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
    suite.addTest(MultisetTestSuiteBuilder.using(new TestStringMultisetGenerator() {

        @Override
        protected Multiset<String> create(String[] elements) {
            return ImmutableMultiset.<String>builder().add(elements).buildJdkBacked();
        }
    }).named("ImmutableMultiset [JDK backed]").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
    suite.addTest(SetTestSuiteBuilder.using(new TestStringSetGenerator() {

        @Override
        protected Set<String> create(String[] elements) {
            return ImmutableMultiset.copyOf(elements).elementSet();
        }
    }).named("ImmutableMultiset, element set").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
    suite.addTest(ListTestSuiteBuilder.using(new TestStringListGenerator() {

        @Override
        protected List<String> create(String[] elements) {
            return ImmutableMultiset.copyOf(elements).asList();
        }

        @Override
        public List<String> order(List<String> insertionOrder) {
            List<String> order = new ArrayList<>();
            for (String s : insertionOrder) {
                int index = order.indexOf(s);
                if (index == -1) {
                    order.add(s);
                } else {
                    order.add(index, s);
                }
            }
            return order;
        }
    }).named("ImmutableMultiset.asList").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
    suite.addTest(ListTestSuiteBuilder.using(new TestStringListGenerator() {

        @Override
        protected List<String> create(String[] elements) {
            Set<String> set = new HashSet<>();
            ImmutableMultiset.Builder<String> builder = ImmutableMultiset.builder();
            for (String s : elements) {
                checkArgument(set.add(s));
                builder.addCopies(s, 2);
            }
            ImmutableSet<String> elementSet = (ImmutableSet<String>) builder.build().elementSet();
            return elementSet.asList();
        }
    }).named("ImmutableMultiset.elementSet.asList").withFeatures(CollectionSize.ANY, CollectionFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
    return suite;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) ListTestSuiteBuilder(com.google.common.collect.testing.ListTestSuiteBuilder) SetTestSuiteBuilder(com.google.common.collect.testing.SetTestSuiteBuilder) MultisetTestSuiteBuilder(com.google.common.collect.testing.google.MultisetTestSuiteBuilder) TestStringListGenerator(com.google.common.collect.testing.TestStringListGenerator) TestStringSetGenerator(com.google.common.collect.testing.TestStringSetGenerator) TestSuite(junit.framework.TestSuite) TestStringMultisetGenerator(com.google.common.collect.testing.google.TestStringMultisetGenerator) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 40 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ImmutableSetMultimapTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(ImmutableSetMultimapTest.class);
    suite.addTest(SetMultimapTestSuiteBuilder.using(new ImmutableSetMultimapGenerator()).named("ImmutableSetMultimap").withFeatures(ALLOWS_ANY_NULL_QUERIES, KNOWN_ORDER, SERIALIZABLE, CollectionSize.ANY).createTestSuite());
    suite.addTest(SetMultimapTestSuiteBuilder.using(new ImmutableSetMultimapCopyOfEntriesGenerator()).named("ImmutableSetMultimap.copyOf[Iterable<Entry>]").withFeatures(ALLOWS_ANY_NULL_QUERIES, KNOWN_ORDER, SERIALIZABLE, CollectionSize.ANY).createTestSuite());
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Aggregations

GwtIncompatible (com.google.common.annotations.GwtIncompatible)361 NullPointerTester (com.google.common.testing.NullPointerTester)105 TestSuite (junit.framework.TestSuite)54 BigInteger (java.math.BigInteger)40 RoundingMode (java.math.RoundingMode)39 CountDownLatch (java.util.concurrent.CountDownLatch)25 ExecutorService (java.util.concurrent.ExecutorService)18 CancellationException (java.util.concurrent.CancellationException)17 Random (java.util.Random)16 ListTestSuiteBuilder (com.google.common.collect.testing.ListTestSuiteBuilder)15 ExecutionException (java.util.concurrent.ExecutionException)15 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)15 IOException (java.io.IOException)14 BigDecimal (java.math.BigDecimal)14 TestStringSetGenerator (com.google.common.collect.testing.TestStringSetGenerator)11 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)11 TimeoutException (java.util.concurrent.TimeoutException)11 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)11 EqualsTester (com.google.common.testing.EqualsTester)10 List (java.util.List)10