Java 类com.google.common.collect.testing.google.DerivedGoogleCollectionGenerators.InverseBiMapGenerator 实例源码

项目:guava-libraries    文件:BiMapTestSuiteBuilder.java   
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;
}
项目:guava-mock    文件:BiMapTestSuiteBuilder.java   
@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;
}
项目:googles-monorepo-demo    文件:BiMapTestSuiteBuilder.java   
@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;
}
项目:guava    文件:BiMapTestSuiteBuilder.java   
@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;
}
项目:guava    文件:BiMapTestSuiteBuilder.java   
@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;
}