Package com.google.common.testing

Examples of com.google.common.testing.NullPointerTester


    assertEquals(hashmap.toString(), Maps.toStringImpl(hashmap));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointerExceptions() {
    new NullPointerTester().testAllPublicStaticMethods(Maps.class);
  }
View Full Code Here


    thread.join();
    assertTrue(completed);
  }

  public void testNulls() {
    NullPointerTester npTester = new NullPointerTester();
    npTester.testAllPublicConstructors(ThreadFactoryBuilder.class);
    npTester.testAllPublicStaticMethods(ThreadFactoryBuilder.class);
    npTester.testAllPublicInstanceMethods(builder);
  }
View Full Code Here

@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {

  @GwtIncompatible("NullPointerTester")
  public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(FluentIterable.class);
  }
View Full Code Here

        .testEquals();
  }

  @GwtIncompatible("reflection")
  public void testNulls() throws Exception {
    new NullPointerTester()
        .setDefault(Class.class, Color.class)
        .setDefault(Iterable.class, EnumSet.allOf(Color.class))
        .testAllPublicStaticMethods(EnumMultiset.class);
  }
View Full Code Here

    return new TypeToken<T[]>() {}
        .where(new TypeParameter<T>() {}, componentType);
  }

  public <T> void testNulls() {
    new NullPointerTester()
        .testAllPublicStaticMethods(TypeToken.class);
    new NullPointerTester()
        .setDefault(TypeParameter.class, new TypeParameter<T>() {})
        .testAllPublicInstanceMethods(TypeToken.of(String.class));
  }
View Full Code Here

    }
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Splitter.class);
    tester.testAllPublicInstanceMethods(Splitter.on(','));
    tester.testAllPublicInstanceMethods(Splitter.on(',').trimResults());
  }
View Full Code Here

  }

  // null parameters test

  public void testNullParameters() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    CacheLoader<Object, Object> loader = identityLoader();
    tester.testAllPublicInstanceMethods(makeCache(createCacheBuilder(), loader));
  }
View Full Code Here

    assertEquals(2, queue.size());
    assertEquals(1, queue.remainingCapacity());
  }

  public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(EvictingQueue.class);
    tester.testAllPublicConstructors(EvictingQueue.class);
    EvictingQueue<String> queue = EvictingQueue.create(5);
    // The queue must be non-empty so it throws a NPE correctly
    queue.add("one");
    tester.testAllPublicInstanceMethods(queue);
  }
View Full Code Here

    } catch (UnsupportedOperationException expected) {
    }
  }

  public void testNullPointers() {
    new NullPointerTester().testAllPublicStaticMethods(Throwables.class);
  }
View Full Code Here

    assertSame(Collections.emptyList(), Shorts.asList(EMPTY));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNulls() {
    new NullPointerTester().testAllPublicStaticMethods(Shorts.class);
  }
View Full Code Here

TOP

Related Classes of com.google.common.testing.NullPointerTester

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.