Search in sources :

Example 96 with GwtIncompatible

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

the class DoubleArrayAsListTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    List<ListTestSuiteBuilder<Double>> builders = ImmutableList.of(ListTestSuiteBuilder.using(new DoublesAsListGenerator()).named("Doubles.asList"), ListTestSuiteBuilder.using(new DoublsAsListHeadSubListGenerator()).named("Doubles.asList, head subList"), ListTestSuiteBuilder.using(new DoublesAsListTailSubListGenerator()).named("Doubles.asList, tail subList"), ListTestSuiteBuilder.using(new DoublesAsListMiddleSubListGenerator()).named("Doubles.asList, middle subList"));
    TestSuite suite = new TestSuite();
    for (ListTestSuiteBuilder<Double> builder : builders) {
        suite.addTest(builder.withFeatures(CollectionSize.ONE, CollectionSize.SEVERAL, CollectionFeature.RESTRICTS_ELEMENTS, ListFeature.SUPPORTS_SET).createTestSuite());
    }
    return suite;
}
Also used : ListTestSuiteBuilder(com.google.common.collect.testing.ListTestSuiteBuilder) TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 97 with GwtIncompatible

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

the class IntArrayAsListTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    List<ListTestSuiteBuilder<Integer>> builders = ImmutableList.of(ListTestSuiteBuilder.using(new IntsAsListGenerator()).named("Ints.asList"), ListTestSuiteBuilder.using(new IntsAsListHeadSubListGenerator()).named("Ints.asList, head subList"), ListTestSuiteBuilder.using(new IntsAsListTailSubListGenerator()).named("Ints.asList, tail subList"), ListTestSuiteBuilder.using(new IntsAsListMiddleSubListGenerator()).named("Ints.asList, middle subList"));
    TestSuite suite = new TestSuite();
    for (ListTestSuiteBuilder<Integer> builder : builders) {
        suite.addTest(builder.withFeatures(CollectionSize.ONE, CollectionSize.SEVERAL, CollectionFeature.RESTRICTS_ELEMENTS, ListFeature.SUPPORTS_SET).createTestSuite());
    }
    return suite;
}
Also used : ListTestSuiteBuilder(com.google.common.collect.testing.ListTestSuiteBuilder) TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 98 with GwtIncompatible

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

the class InternetDomainNameTest method testNulls.

// NullPointerTester
@GwtIncompatible
public void testNulls() {
    final NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(InternetDomainName.class);
    tester.testAllPublicInstanceMethods(InternetDomainName.from("google.com"));
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 99 with GwtIncompatible

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

the class LongMathTest method testDivNonZero.

// TODO
@GwtIncompatible
// TODO(cpovirk): File BigDecimal.divide() rounding bug.
@AndroidIncompatible
public void testDivNonZero() {
    for (long p : NONZERO_LONG_CANDIDATES) {
        for (long q : NONZERO_LONG_CANDIDATES) {
            for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
                long expected = new BigDecimal(valueOf(p)).divide(new BigDecimal(valueOf(q)), 0, mode).longValue();
                long actual = LongMath.divide(p, q, mode);
                if (expected != actual) {
                    failFormat("expected divide(%s, %s, %s) = %s; got %s", p, q, mode, expected, actual);
                }
            }
        }
    }
}
Also used : RoundingMode(java.math.RoundingMode) BigDecimal(java.math.BigDecimal) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 100 with GwtIncompatible

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

the class LongMathTest method testCheckedPow.

// TODO
@GwtIncompatible
public void testCheckedPow() {
    for (long b : ALL_LONG_CANDIDATES) {
        for (int exp : EXPONENTS) {
            BigInteger expectedResult = valueOf(b).pow(exp);
            boolean expectedSuccess = fitsInLong(expectedResult);
            try {
                assertEquals(expectedResult.longValue(), LongMath.checkedPow(b, exp));
                assertTrue(expectedSuccess);
            } catch (ArithmeticException e) {
                if (expectedSuccess) {
                    failFormat("expected checkedPow(%s, %s) = %s; got ArithmeticException", b, exp, expectedResult);
                }
            }
        }
    }
}
Also used : BigInteger(java.math.BigInteger) 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