@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; }
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; }
@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; }