use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testPut2_NullPointerException.
/**
* put(x, null) throws NPE
*/
@Test
public void testPut2_NullPointerException() {
try {
CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
c.put("whatever", null);
shouldThrow();
} catch (NullPointerException e) {
}
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testContainsValue_NullPointerException.
/**
* containsValue(null) throws NPE
*/
@Test
public void testContainsValue_NullPointerException() {
try {
CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
c.containsValue(null);
shouldThrow();
} catch (NullPointerException e) {
}
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testPutIfAbsent1_NullPointerException.
/**
* putIfAbsent(null, x) throws NPE
*/
@Test
public void testPutIfAbsent1_NullPointerException() {
try {
CustomEntryConcurrentHashMap c = new CustomEntryConcurrentHashMap(5);
c.putIfAbsent(null, "whatever");
shouldThrow();
} catch (NullPointerException e) {
}
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method testEquals.
/**
* Maps with same contents are equal
*/
@Test
public void testEquals() {
CustomEntryConcurrentHashMap map1 = map5();
CustomEntryConcurrentHashMap map2 = map5();
assertEquals(map1, map2);
assertEquals(map2, map1);
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
}
use of org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap in project geode by apache.
the class ConcurrentHashMapJUnitTest method map5.
/**
* Create a map from Integers 1-5 to Strings "A"-"E".
*/
private static CustomEntryConcurrentHashMap map5() {
CustomEntryConcurrentHashMap map = new CustomEntryConcurrentHashMap(5);
assertTrue(map.isEmpty());
map.put(one, "A");
map.put(two, "B");
map.put(three, "C");
map.put(four, "D");
map.put(five, "E");
assertFalse(map.isEmpty());
assertEquals(5, map.size());
return map;
}
Aggregations