Java Code Examples for com.google.common.collect.testing.google.DerivedGoogleCollectionGenerators.BiMapValueSetGenerator

The following are top voted examples for showing how to use com.google.common.collect.testing.google.DerivedGoogleCollectionGenerators.BiMapValueSetGenerator. 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-libraries   File: BiMapTestSuiteBuilder.java   View source code 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 2
Project: guava-mock   File: BiMapTestSuiteBuilder.java   View source code 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 3
Project: googles-monorepo-demo   File: BiMapTestSuiteBuilder.java   View source code 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 4
Project: guava   File: BiMapTestSuiteBuilder.java   View source code 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 5
Project: guava   File: BiMapTestSuiteBuilder.java   View source code 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;
}