use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testReplace.
/**
* replace fails when the given key is not present
*/
@Test
public void testReplace() {
CustomEntryConcurrentHashMap map = map5();
assertNull(map.replace(six, "Z"));
assertFalse(map.containsKey(six));
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testContains.
/**
* contains returns true for contained value
*/
@Test
public void testContains() {
CustomEntryConcurrentHashMap map = map5();
assertTrue(map.contains("A"));
assertFalse(map.contains("Z"));
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testReplaceValue2.
/**
* replace value succeeds when the given key mapped to expected value
*/
@Test
public void testReplaceValue2() {
CustomEntryConcurrentHashMap map = map5();
assertEquals("A", map.get(one));
assertTrue(map.replace(one, "A", "Z"));
assertEquals("Z", map.get(one));
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testContainsKey.
/**
* containsKey returns true for contained key
*/
@Test
public void testContainsKey() {
CustomEntryConcurrentHashMap map = map5();
assertTrue(map.containsKey(one));
assertFalse(map.containsKey(zero));
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testRemove2_NullPointerException.
/**
* remove(null, x) throws NPE
*/
@Test
public void testRemove2_NullPointerException() {
try {
CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
c.put("sadsdf", "asdads");
c.remove(null, "whatever");
shouldThrow();
} catch (NullPointerException e) {
}
}
Aggregations