From a0c68a3f5a0a0de8287324fe1189f753c35b8367 Mon Sep 17 00:00:00 2001 From: "Craig P. Motlin" Date: Mon, 3 Jun 2024 08:02:51 -0400 Subject: [PATCH] Remove redundant tests from unit-tests that live in unit-tests-java8. --- .../mutable/AbstractMutableBiMapTestCase.java | 1 - .../mutable/MutableMapIterableTestCase.java | 19 ------------------- .../impl/map/mutable/UnifiedMapTest.java | 3 --- .../mutable/UnmodifiableMutableMapTest.java | 7 ------- .../mutable/MutableSortedMapTestCase.java | 16 ---------------- .../mutable/UnmodifiableTreeMapTest.java | 8 -------- .../UnifiedMapWithHashingStrategyTest.java | 3 --- 7 files changed, 57 deletions(-) diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/bimap/mutable/AbstractMutableBiMapTestCase.java b/unit-tests/src/test/java/org/eclipse/collections/impl/bimap/mutable/AbstractMutableBiMapTestCase.java index f4bcf42e46..a11fce54f0 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/bimap/mutable/AbstractMutableBiMapTestCase.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/bimap/mutable/AbstractMutableBiMapTestCase.java @@ -113,7 +113,6 @@ public void forcePut() AbstractMutableBiMapTestCase.assertBiMapsEqual(HashBiMap.newWithKeysValues(1, null), actual); } - @Override @Test public void put() { diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/MutableMapIterableTestCase.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/MutableMapIterableTestCase.java index bd07b91fc8..92fe41eb03 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/MutableMapIterableTestCase.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/MutableMapIterableTestCase.java @@ -17,10 +17,8 @@ import java.util.SortedMap; import java.util.concurrent.ConcurrentMap; -import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.factory.Maps; import org.eclipse.collections.api.factory.Sets; -import org.eclipse.collections.api.list.ImmutableList; import org.eclipse.collections.api.list.MutableList; import org.eclipse.collections.api.map.ImmutableMapIterable; import org.eclipse.collections.api.map.MapIterable; @@ -296,23 +294,6 @@ public void retainAllFromValues() assertEquals(UnifiedMap.newWithKeysValues("One", 1, "Three", 3), map); } - @Test - public void put() - { - MutableMapIterable map = this.newMapWithKeysValues(1, "One", 2, "Two"); - assertNull(map.put(3, "Three")); - assertEquals(UnifiedMap.newWithKeysValues(1, "One", 2, "Two", 3, "Three"), map); - - ImmutableList key1 = Lists.immutable.with(null); - ImmutableList key2 = Lists.immutable.with(null); - Object value1 = new Object(); - Object value2 = new Object(); - MutableMapIterable, Object> map2 = this.newMapWithKeyValue(key1, value1); - Object previousValue = map2.put(key2, value2); - assertSame(value1, previousValue); - assertSame(key1, map2.keysView().getFirst()); - } - @Test public void putAll() { diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnifiedMapTest.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnifiedMapTest.java index 1f08e75d42..587293d344 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnifiedMapTest.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnifiedMapTest.java @@ -532,12 +532,9 @@ public void getIfAbsentPut_block_throws() assertEquals(this.mapWithCollisionsOfSize(5), map); } - @Override @Test public void put() { - super.put(); - // this map is deliberately small to force a rehash to occur from the put method, in a map with a chained bucket UnifiedMap map = UnifiedMap.newMap(2, 0.75f); COLLISIONS.subList(0, 5).forEach(Procedures.cast(each -> assertNull(map.put(each, each)))); diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnmodifiableMutableMapTest.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnmodifiableMutableMapTest.java index 8cc930cbe3..84ff1d63ce 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnmodifiableMutableMapTest.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/mutable/UnmodifiableMutableMapTest.java @@ -457,13 +457,6 @@ public void entrySetToArrayWithTarget() assertEquals(ImmutableEntry.of(1, "One"), entries[0]); } - @Override - @Test - public void put() - { - assertThrows(UnsupportedOperationException.class, super::put); - } - @Override @Test public void testClone() diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/MutableSortedMapTestCase.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/MutableSortedMapTestCase.java index 55dcfbfa48..2188bc6b6b 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/MutableSortedMapTestCase.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/MutableSortedMapTestCase.java @@ -56,7 +56,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -654,21 +653,6 @@ public void keySetEqualsAndHashCode() Verify.assertEqualsAndHashCode(TreeSortedSet.newSetWith("One", "Two", "Three"), map.keySet()); } - @Override - @Test - public void put() - { - // Only use Comparable objects - - MutableSortedMap map = this.newMapWithKeysValues(1, "One", 2, "Two"); - assertNull(map.put(3, "Three")); - assertEquals(TreeSortedMap.newMapWith(1, "One", 2, "Two", 3, "Three"), map); - - MutableSortedMap revMap = this.newMapWithKeysValues(REV_INT_ORDER, 1, "One", 2, "Two"); - assertNull(revMap.put(0, "Zero")); - assertEquals(TreeSortedMap.newMap(REV_INT_ORDER).with(0, "Zero", 1, "One", 2, "Two"), revMap); - } - @Override @Test public void putAll() diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/UnmodifiableTreeMapTest.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/UnmodifiableTreeMapTest.java index 7540c439cd..e3a0a007a2 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/UnmodifiableTreeMapTest.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/sorted/mutable/UnmodifiableTreeMapTest.java @@ -339,14 +339,6 @@ public void entrySetToArrayWithTarget() assertEquals(ImmutableEntry.of(1, "One"), entries[0]); } - @Override - @Test - public void put() - { - MutableSortedMap map = this.newMapWithKeysValues(1, "One", 2, "Two"); - assertThrows(UnsupportedOperationException.class, () -> map.put(3, "Three")); - } - @Override @Test public void add() diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/map/strategy/mutable/UnifiedMapWithHashingStrategyTest.java b/unit-tests/src/test/java/org/eclipse/collections/impl/map/strategy/mutable/UnifiedMapWithHashingStrategyTest.java index a25d926fb1..81c1370fe1 100644 --- a/unit-tests/src/test/java/org/eclipse/collections/impl/map/strategy/mutable/UnifiedMapWithHashingStrategyTest.java +++ b/unit-tests/src/test/java/org/eclipse/collections/impl/map/strategy/mutable/UnifiedMapWithHashingStrategyTest.java @@ -827,12 +827,9 @@ public void equals_with_hashing_strategy() assertNotEquals(map5, unifiedMap); } - @Override @Test public void put() { - super.put(); - // this map is deliberately small to force a rehash to occur from the put method, in a map with a chained bucket UnifiedMapWithHashingStrategy map = UnifiedMapWithHashingStrategy.newMap( INTEGER_HASHING_STRATEGY, 2, 0.75f);