Merge branch 'pr-190'

This closes #190
This commit is contained in:
Bruno P. Kinoshita 2020-10-12 15:25:02 +13:00
commit 7e953fd6dd
2 changed files with 17 additions and 4 deletions

View File

@ -21,6 +21,9 @@
</properties>
<body>
<release version="4.5" date="2020-MM-DD" description="Maintenance release.">
<action issue="COLLECTIONS-769" dev="kinow" type="fix" due-to="Xin (Cynthia) Tong">
Fix flaky UnmodifiableMultiValuedMapTest.
</action>
<action type="update" dev="kinow" due-to="Dependabot">
Bump actions/setup-java from v1.4.0 to v1.4.3 #174 #177 #186.
</action>

View File

@ -47,7 +47,17 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
return BulkTest.makeSuite(UnmodifiableMultiValuedMapTest.class);
}
// -----------------------------------------------------------------------
/**
* Assert the given map contains all added values after it was initialized
* with makeFullMap(). See COLLECTIONS-769.
* @param map the MultiValuedMap<K, V> to check
*/
private void assertMapContainsAllValues(MultiValuedMap<K, V> map) {
assertEquals("[uno, un]", map.get((K) "one").toString());
assertEquals("[dos, deux]", map.get((K) "two").toString());
assertEquals("[tres, trois]", map.get((K) "three").toString());
}
@Override
public boolean isAddSupported() {
return false;
@ -110,7 +120,7 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
// expected, not support remove() method
// UnmodifiableMultiValuedMap does not support change
}
assertEquals("{one=[uno, un], two=[dos, deux], three=[tres, trois]}", map.toString());
this.assertMapContainsAllValues(map);
}
public void testRemoveMappingException() {
@ -122,7 +132,7 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
// expected, not support removeMapping() method
// UnmodifiableMultiValuedMap does not support change
}
assertEquals("{one=[uno, un], two=[dos, deux], three=[tres, trois]}", map.toString());
this.assertMapContainsAllValues(map);
}
public void testClearException() {
@ -134,7 +144,7 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
// expected, not support clear() method
// UnmodifiableMultiValuedMap does not support change
}
assertEquals("{one=[uno, un], two=[dos, deux], three=[tres, trois]}", map.toString());
this.assertMapContainsAllValues(map);
}
public void testPutAllException() {