use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testRemove1_NullPointerException.
/**
* remove(null) throws NPE
*/
public void testRemove1_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.put("sadsdf", "asdads");
c.remove(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testPutIfAbsent2.
/**
* putIfAbsent does not add the pair if the key is already present
*/
public void testPutIfAbsent2() {
ConcurrentMap map = map5();
assertEquals("A", map.putIfAbsent(one, "Z"));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testContainsKey.
/**
* containsKey returns true for contained key
*/
public void testContainsKey() {
ConcurrentMap map = map5();
assertTrue(map.containsKey(one));
assertFalse(map.containsKey(zero));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testRemove.
/**
* remove removes the correct key-value pair from the map
*/
public void testRemove() {
ConcurrentMap map = map5();
map.remove(five);
assertEquals(4, map.size());
assertFalse(map.containsKey(five));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testReplaceValue2_NullPointerException.
/**
* replace(x, null, y) throws NPE
*/
public void testReplaceValue2_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.replace("whatever", null, "A");
shouldThrow();
} catch (NullPointerException success) {
}
}
Aggregations