use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testReplaceValue_NullPointerException.
/**
* replace(null, x, y) throws NPE
*/
@Test
public void testReplaceValue_NullPointerException() {
ConcurrentMap c = makeMap();
try {
c.replace(null, one, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testRemove3.
/**
* remove(x, null) returns false
*/
@Test(expected = NullPointerException.class)
public void testRemove3() {
ConcurrentMap c = makeGenericMap();
c.put("sadsdf", "asdads");
c.remove("sadsdf", null);
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testContainsKey.
/**
* containsKey returns true for contained key
*/
@Test
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 testReplaceValue.
/**
* replace value fails when the given key not mapped to expected value
*/
public void testReplaceValue() {
ConcurrentMap map = map5();
assertEquals("A", map.get(one));
assertFalse(map.replace(one, "Z", "Z"));
assertEquals("A", map.get(one));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testContainsKey_NullPointerException.
/**
* containsKey(null) throws NPE
*/
public void testContainsKey_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.containsKey(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
Aggregations