This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
The following commit(s) were added to refs/heads/master by this push:
new 7bc8ae865 Make AbstractMapTest.testReplaceAll() more flexible for
subclasses
7bc8ae865 is described below
commit 7bc8ae8650bb6aef0744fa9ade3f4271c5cd5133
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Oct 3 07:30:05 2024 -0400
Make AbstractMapTest.testReplaceAll() more flexible for subclasses
---
.../apache/commons/collections4/map/AbstractMapTest.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git
a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
index b2832a87c..919dc46b7 100644
--- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
@@ -813,6 +813,17 @@ public abstract class AbstractMapTest<K, V> extends
AbstractObjectTest {
return true;
}
+ /**
+ * Returns true if the maps produced by {@link #makeObject()} and {@link
#makeFullMap()} support the {@link
Map#replaceAll(java.util.function.BiFunction)}
+ * operations.
+ * <p>
+ * Default implementation returns true. Override if your collection class
does not support replaceAll operations.
+ * </p>
+ */
+ public boolean isReplaceAllSupported() {
+ return true;
+ }
+
/**
* Returns true if the maps produced by {@link #makeObject()} and {@link
#makeFullMap()} support the {@code setValue} operation on entrySet entries.
* <p>
@@ -2172,7 +2183,7 @@ public abstract class AbstractMapTest<K, V> extends
AbstractObjectTest {
*/
@Test
public void testReplaceAll() {
- assumeTrue(isSetValueSupported());
+ assumeTrue(isSetValueSupported() && isReplaceAllSupported());
resetFull();
final V[] newValues = getNewSampleValues();
assertFalse(getMap().isEmpty());