Package com.google.common.collect.testing

Examples of com.google.common.collect.testing.TestStringMapGenerator


  public static Test suite(){
    TestSuite suite = new TestSuite();
    suite.addTestSuite(TreeBasedTableTest.class);
    suite.addTestSuite(TreeRowTest.class);
    suite.addTest(MapTestSuiteBuilder
        .using(new TestStringMapGenerator() {
          @Override protected Map<String, String> create(
              Entry<String, String>[] entries) {
            TreeBasedTable<String, String, String> table =
                TreeBasedTable.create();
            table.put("a", "b", "c");
View Full Code Here


  public static class FilteredMapTests extends TestCase {
    public static Test suite() {
      TestSuite suite = new TestSuite();

      suite.addTest(MapTestSuiteBuilder.using(
          new TestStringMapGenerator() {
            @Override protected Map<String, String> create(
                Entry<String, String>[] entries) {
              Map<String, String> map = Maps.newHashMap();
              for (Entry<String, String> entry : entries) {
                map.put(entry.getKey(), entry.getValue());
              }
              map.putAll(ENTRIES_TO_FILTER_OUT);
              return Maps.filterKeys(map, new Predicate<String>() {
                @Override
                public boolean apply(String input) {
                  return input == null
                      || (input.charAt(0) >= 'a' && input.charAt(0) <= 'z');
                }
              });
            }
          })
          .named("Maps.filterKeys")
          .withFeatures(
              CollectionSize.ANY,
              MapFeature.ALLOWS_NULL_KEYS,
              MapFeature.ALLOWS_NULL_VALUES,
              MapFeature.GENERAL_PURPOSE)
          .suppressing(getIteratorUnknownOrderRemoveSupportedMethod())
          .createTestSuite());

      suite.addTest(MapTestSuiteBuilder.using(
          new TestStringMapGenerator() {
            @Override protected Map<String, String> create(
                Entry<String, String>[] entries) {
              Map<String, String> map = Maps.newHashMap();
              for (Entry<String, String> entry : entries) {
                map.put(entry.getKey(), entry.getValue());
              }
              map.putAll(ENTRIES_TO_FILTER_OUT);
              return Maps.filterValues(map, new Predicate<String>() {
                @Override
                public boolean apply(String input) {
                  return input == null
                      || (input.charAt(0) >= 'A' && input.charAt(0) <= 'Z');
                }
              });
            }
          })
          .named("Maps.filterValues")
          .withFeatures(
              CollectionSize.ANY,
              MapFeature.ALLOWS_NULL_KEYS,
              MapFeature.ALLOWS_NULL_VALUES,
              MapFeature.GENERAL_PURPOSE)
          .suppressing(getIteratorUnknownOrderRemoveSupportedMethod())
          .createTestSuite());

      suite.addTest(MapTestSuiteBuilder.using(
          new TestStringMapGenerator() {
            @Override protected Map<String, String> create(
                Entry<String, String>[] entries) {
              Map<String, String> map = Maps.newHashMap();
              for (Entry<String, String> entry : entries) {
                map.put(entry.getKey(), entry.getValue());
              }
              map.putAll(ENTRIES_TO_FILTER_OUT);
              return Maps.filterEntries(map,
                  new Predicate<Entry<String, String>>() {
                    @Override
                    public boolean apply(Entry<String, String> entry) {
                      String input = entry.getKey();
                      return input == null
                          || (input.charAt(0) >= 'a' && input.charAt(0) <= 'z');
                    }
                  });
            }
          })
          .named("Maps.filterEntries")
          .withFeatures(
              CollectionSize.ANY,
              MapFeature.ALLOWS_NULL_KEYS,
              MapFeature.ALLOWS_NULL_VALUES,
              MapFeature.GENERAL_PURPOSE)
          .suppressing(getIteratorUnknownOrderRemoveSupportedMethod())
          .createTestSuite());

      suite.addTest(MapTestSuiteBuilder.using(
          new TestStringMapGenerator() {
            @Override protected Map<String, String> create(
                Entry<String, String>[] entries) {
              Map<String, String> map = Maps.newHashMap();
              for (Entry<String, String> entry : entries) {
                map.put(entry.getKey(), entry.getValue());
View Full Code Here

{
  public static TestSuite
  suite()
  {
    return MapTestSuiteBuilder
      .using(new TestStringMapGenerator() {
          @Override protected Map<String, String>
          create(Entry<String, String>[] entries)
          {
            return toMap(entries);
          }
View Full Code Here

{
  public static TestSuite
  suite()
  {
    return MapTestSuiteBuilder
      .using(new TestStringMapGenerator() {
          @Override protected Map<String, String>
          create(Entry<String, String>[] entries)
          {
            return toMap(entries);
          }
View Full Code Here

TOP

Related Classes of com.google.common.collect.testing.TestStringMapGenerator

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.