Skip to content

Commit

Permalink
Remove redundant tests from unit-tests that live in unit-tests-java8.
Browse files Browse the repository at this point in the history
  • Loading branch information
motlin committed Sep 5, 2024
1 parent 2091dff commit a0c68a3
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void forcePut()
AbstractMutableBiMapTestCase.assertBiMapsEqual(HashBiMap.newWithKeysValues(1, null), actual);
}

@Override
@Test
public void put()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -296,23 +294,6 @@ public void retainAllFromValues()
assertEquals(UnifiedMap.newWithKeysValues("One", 1, "Three", 3), map);
}

@Test
public void put()
{
MutableMapIterable<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two");
assertNull(map.put(3, "Three"));
assertEquals(UnifiedMap.newWithKeysValues(1, "One", 2, "Two", 3, "Three"), map);

ImmutableList<Integer> key1 = Lists.immutable.with(null);
ImmutableList<Integer> key2 = Lists.immutable.with(null);
Object value1 = new Object();
Object value2 = new Object();
MutableMapIterable<ImmutableList<Integer>, Object> map2 = this.newMapWithKeyValue(key1, value1);
Object previousValue = map2.put(key2, value2);
assertSame(value1, previousValue);
assertSame(key1, map2.keysView().getFirst());
}

@Test
public void putAll()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer, Integer> map = UnifiedMap.newMap(2, 0.75f);
COLLISIONS.subList(0, 5).forEach(Procedures.cast(each -> assertNull(map.put(each, each))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two");
assertNull(map.put(3, "Three"));
assertEquals(TreeSortedMap.newMapWith(1, "One", 2, "Two", 3, "Three"), map);

MutableSortedMap<Integer, String> revMap = this.newMapWithKeysValues(REV_INT_ORDER, 1, "One", 2, "Two");
assertNull(revMap.put(0, "Zero"));
assertEquals(TreeSortedMap.<Integer, String>newMap(REV_INT_ORDER).with(0, "Zero", 1, "One", 2, "Two"), revMap);
}

@Override
@Test
public void putAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,6 @@ public void entrySetToArrayWithTarget()
assertEquals(ImmutableEntry.of(1, "One"), entries[0]);
}

@Override
@Test
public void put()
{
MutableSortedMap<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two");
assertThrows(UnsupportedOperationException.class, () -> map.put(3, "Three"));
}

@Override
@Test
public void add()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer, Integer> map = UnifiedMapWithHashingStrategy.newMap(
INTEGER_HASHING_STRATEGY, 2, 0.75f);
Expand Down

0 comments on commit a0c68a3

Please sign in to comment.