Rework test fixtures

Next, grow the amount of data tested to find bugs in the tests with
non-repeatable map ordering
This commit is contained in:
Gary Gregory 2024-03-31 10:31:52 -04:00
parent 8cae451853
commit 31b4116858
1 changed files with 12 additions and 4 deletions

View File

@ -1257,10 +1257,18 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
assumeTrue(isRemoveSupported()); assumeTrue(isRemoveSupported());
final MultiValuedMap<K, V> map = makeFullMap(); final MultiValuedMap<K, V> map = makeFullMap();
final Collection<V> values = map.values(); final Collection<V> values = map.values();
values.remove("v0_0"); final int maxK = getSampleKeySize();
values.remove("v0_1"); final int maxV = getSampleCountPerKey();
assertFalse(map.containsKey("k0")); int expectedSize = map.size();
assertEquals(4, map.size()); for (int k = 0; k < maxK; k++) {
for (int v = 0; v < maxV; v++) {
values.remove(makeValue(k, v));
}
assertFalse(map.containsKey(makeKey(k)));
expectedSize -= maxV;
assertEquals(expectedSize, map.size());
}
assertEquals(0, map.size());
} }
@Test @Test