Java Code Examples for com.google.common.collect.testing.testers.SetCreationTester

The following are top voted examples for showing how to use com.google.common.collect.testing.testers.SetCreationTester. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: guava-mock   File: SetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
  List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());

  testers.add(CollectionSerializationEqualTester.class);
  testers.add(SetAddAllTester.class);
  testers.add(SetAddTester.class);
  testers.add(SetCreationTester.class);
  testers.add(SetHashCodeTester.class);
  testers.add(SetEqualsTester.class);
  testers.add(SetRemoveTester.class);
  // SetRemoveAllTester doesn't exist because, Sets not permitting
  // duplicate elements, there are no tests for Set.removeAll() that aren't
  // covered by CollectionRemoveAllTester.
  return testers;
}
 
Example 2
Project: googles-monorepo-demo   File: SetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
  List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());

  testers.add(CollectionSerializationEqualTester.class);
  testers.add(SetAddAllTester.class);
  testers.add(SetAddTester.class);
  testers.add(SetCreationTester.class);
  testers.add(SetHashCodeTester.class);
  testers.add(SetEqualsTester.class);
  testers.add(SetRemoveTester.class);
  // SetRemoveAllTester doesn't exist because, Sets not permitting
  // duplicate elements, there are no tests for Set.removeAll() that aren't
  // covered by CollectionRemoveAllTester.
  return testers;
}
 
Example 3
Project: guava-libraries   File: SetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
@Override protected List<Class<? extends AbstractTester>> getTesters() {
  List<Class<? extends AbstractTester>> testers
      = Helpers.copyToList(super.getTesters());
  
  testers.add(CollectionSerializationEqualTester.class);
  testers.add(SetAddAllTester.class);
  testers.add(SetAddTester.class);
  testers.add(SetCreationTester.class);
  testers.add(SetHashCodeTester.class);
  testers.add(SetEqualsTester.class);
  testers.add(SetRemoveTester.class);
  // SetRemoveAllTester doesn't exist because, Sets not permitting
  // duplicate elements, there are no tests for Set.removeAll() that aren't
  // covered by CollectionRemoveAllTester.
  return testers;
}
 
Example 4
Project: guava   File: SetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
  List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());

  testers.add(CollectionSerializationEqualTester.class);
  testers.add(SetAddAllTester.class);
  testers.add(SetAddTester.class);
  testers.add(SetCreationTester.class);
  testers.add(SetHashCodeTester.class);
  testers.add(SetEqualsTester.class);
  testers.add(SetRemoveTester.class);
  // SetRemoveAllTester doesn't exist because, Sets not permitting
  // duplicate elements, there are no tests for Set.removeAll() that aren't
  // covered by CollectionRemoveAllTester.
  return testers;
}
 
Example 5
Project: guava   File: SetTestSuiteBuilder.java   Source Code and License 6 votes vote down vote up
@Override
protected List<Class<? extends AbstractTester>> getTesters() {
  List<Class<? extends AbstractTester>> testers = Helpers.copyToList(super.getTesters());

  testers.add(CollectionSerializationEqualTester.class);
  testers.add(SetAddAllTester.class);
  testers.add(SetAddTester.class);
  testers.add(SetCreationTester.class);
  testers.add(SetHashCodeTester.class);
  testers.add(SetEqualsTester.class);
  testers.add(SetRemoveTester.class);
  // SetRemoveAllTester doesn't exist because, Sets not permitting
  // duplicate elements, there are no tests for Set.removeAll() that aren't
  // covered by CollectionRemoveAllTester.
  return testers;
}
 
Example 6
Project: guava-libraries   File: BiMapTestSuiteBuilder.java   Source Code and License 5 votes vote down vote up
createDerivedSuites(
        FeatureSpecificTestSuiteBuilder<?,
            ? extends OneSizeTestContainerGenerator<BiMap<K, V>, Entry<K, V>>> parentBuilder) {
  List<TestSuite> derived = super.createDerivedSuites(parentBuilder);
  // TODO(cpovirk): consider using this approach (derived suites instead of extension) in
  // ListTestSuiteBuilder, etc.?
  derived.add(MapTestSuiteBuilder
      .using(new MapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
      .withFeatures(parentBuilder.getFeatures())
      .named(parentBuilder.getName() + " [Map]")
      .suppressing(parentBuilder.getSuppressedTests())
      .suppressing(SetCreationTester.class.getMethods())
         // BiMap.entrySet() duplicate-handling behavior is too confusing for SetCreationTester
      .createTestSuite());
  /*
   * TODO(cpovirk): the Map tests duplicate most of this effort by using a
   * CollectionTestSuiteBuilder on values(). It would be nice to avoid that
   */
  derived.add(SetTestSuiteBuilder
      .using(new BiMapValueSetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
      .withFeatures(computeValuesSetFeatures(parentBuilder.getFeatures()))
      .named(parentBuilder.getName() + " values [Set]")
      .suppressing(parentBuilder.getSuppressedTests())
      .suppressing(SetCreationTester.class.getMethods())
        // BiMap.values() duplicate-handling behavior is too confusing for SetCreationTester
      .createTestSuite());
  if (!parentBuilder.getFeatures().contains(NoRecurse.INVERSE)) {
    derived.add(BiMapTestSuiteBuilder
        .using(new InverseBiMapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
        .withFeatures(computeInverseFeatures(parentBuilder.getFeatures()))
        .named(parentBuilder.getName() + " inverse")
        .suppressing(parentBuilder.getSuppressedTests())
        .createTestSuite());
  }

  return derived;
}
 
Example 7
Project: guava-mock   File: BiMapTestSuiteBuilder.java   Source Code and License 4 votes vote down vote up
@Override
protected List<TestSuite> createDerivedSuites(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<BiMap<K, V>, Entry<K, V>>>
        parentBuilder) {
  List<TestSuite> derived = super.createDerivedSuites(parentBuilder);
  // TODO(cpovirk): consider using this approach (derived suites instead of extension) in
  // ListTestSuiteBuilder, etc.?
  derived.add(
      MapTestSuiteBuilder.using(new MapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(parentBuilder.getFeatures())
          .named(parentBuilder.getName() + " [Map]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.entrySet() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  /*
   * TODO(cpovirk): the Map tests duplicate most of this effort by using a
   * CollectionTestSuiteBuilder on values(). It would be nice to avoid that
   */
  derived.add(
      SetTestSuiteBuilder.using(
              new BiMapValueSetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(computeValuesSetFeatures(parentBuilder.getFeatures()))
          .named(parentBuilder.getName() + " values [Set]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.values() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  if (!parentBuilder.getFeatures().contains(NoRecurse.INVERSE)) {
    derived.add(
        BiMapTestSuiteBuilder.using(
                new InverseBiMapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
            .withFeatures(computeInverseFeatures(parentBuilder.getFeatures()))
            .named(parentBuilder.getName() + " inverse")
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }

  return derived;
}
 
Example 8
Project: googles-monorepo-demo   File: BiMapTestSuiteBuilder.java   Source Code and License 4 votes vote down vote up
@Override
protected List<TestSuite> createDerivedSuites(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<BiMap<K, V>, Entry<K, V>>>
        parentBuilder) {
  List<TestSuite> derived = super.createDerivedSuites(parentBuilder);
  // TODO(cpovirk): consider using this approach (derived suites instead of extension) in
  // ListTestSuiteBuilder, etc.?
  derived.add(
      MapTestSuiteBuilder.using(new MapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(parentBuilder.getFeatures())
          .named(parentBuilder.getName() + " [Map]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.entrySet() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  /*
   * TODO(cpovirk): the Map tests duplicate most of this effort by using a
   * CollectionTestSuiteBuilder on values(). It would be nice to avoid that
   */
  derived.add(
      SetTestSuiteBuilder.using(
              new BiMapValueSetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(computeValuesSetFeatures(parentBuilder.getFeatures()))
          .named(parentBuilder.getName() + " values [Set]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.values() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  if (!parentBuilder.getFeatures().contains(NoRecurse.INVERSE)) {
    derived.add(
        BiMapTestSuiteBuilder.using(
                new InverseBiMapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
            .withFeatures(computeInverseFeatures(parentBuilder.getFeatures()))
            .named(parentBuilder.getName() + " inverse")
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }

  return derived;
}
 
Example 9
Project: guava   File: BiMapTestSuiteBuilder.java   Source Code and License 4 votes vote down vote up
@Override
protected List<TestSuite> createDerivedSuites(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<BiMap<K, V>, Entry<K, V>>>
        parentBuilder) {
  List<TestSuite> derived = super.createDerivedSuites(parentBuilder);
  // TODO(cpovirk): consider using this approach (derived suites instead of extension) in
  // ListTestSuiteBuilder, etc.?
  derived.add(
      MapTestSuiteBuilder.using(new MapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(parentBuilder.getFeatures())
          .named(parentBuilder.getName() + " [Map]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.entrySet() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  /*
   * TODO(cpovirk): the Map tests duplicate most of this effort by using a
   * CollectionTestSuiteBuilder on values(). It would be nice to avoid that
   */
  derived.add(
      SetTestSuiteBuilder.using(
              new BiMapValueSetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(computeValuesSetFeatures(parentBuilder.getFeatures()))
          .named(parentBuilder.getName() + " values [Set]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.values() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  if (!parentBuilder.getFeatures().contains(NoRecurse.INVERSE)) {
    derived.add(
        BiMapTestSuiteBuilder.using(
                new InverseBiMapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
            .withFeatures(computeInverseFeatures(parentBuilder.getFeatures()))
            .named(parentBuilder.getName() + " inverse")
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }

  return derived;
}
 
Example 10
Project: guava   File: BiMapTestSuiteBuilder.java   Source Code and License 4 votes vote down vote up
@Override
protected List<TestSuite> createDerivedSuites(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<BiMap<K, V>, Entry<K, V>>>
        parentBuilder) {
  List<TestSuite> derived = super.createDerivedSuites(parentBuilder);
  // TODO(cpovirk): consider using this approach (derived suites instead of extension) in
  // ListTestSuiteBuilder, etc.?
  derived.add(
      MapTestSuiteBuilder.using(new MapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(parentBuilder.getFeatures())
          .named(parentBuilder.getName() + " [Map]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.entrySet() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  /*
   * TODO(cpovirk): the Map tests duplicate most of this effort by using a
   * CollectionTestSuiteBuilder on values(). It would be nice to avoid that
   */
  derived.add(
      SetTestSuiteBuilder.using(
              new BiMapValueSetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
          .withFeatures(computeValuesSetFeatures(parentBuilder.getFeatures()))
          .named(parentBuilder.getName() + " values [Set]")
          .suppressing(parentBuilder.getSuppressedTests())
          .suppressing(SetCreationTester.class.getMethods())
          // BiMap.values() duplicate-handling behavior is too confusing for SetCreationTester
          .createTestSuite());
  if (!parentBuilder.getFeatures().contains(NoRecurse.INVERSE)) {
    derived.add(
        BiMapTestSuiteBuilder.using(
                new InverseBiMapGenerator<K, V>(parentBuilder.getSubjectGenerator()))
            .withFeatures(computeInverseFeatures(parentBuilder.getFeatures()))
            .named(parentBuilder.getName() + " inverse")
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }

  return derived;
}