use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testContainsValue_NullPointerException.
/**
* containsValue(null) throws NPE
*/
public void testContainsValue_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.containsValue(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testReplace2.
/**
* replace succeeds if the key is already present
*/
public void testReplace2() {
ConcurrentMap map = map5();
assertNotNull(map.replace(one, "Z"));
assertEquals("Z", map.get(one));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testReplace2_NullPointerException.
/**
* replace(x, null) throws NPE
*/
public void testReplace2_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.replace("whatever", null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testReplaceValue2.
/**
* replace value succeeds when the given key mapped to expected value
*/
public void testReplaceValue2() {
ConcurrentMap map = map5();
assertEquals("A", map.get(one));
assertTrue(map.replace(one, "A", "Z"));
assertEquals("Z", map.get(one));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapV8Test method testRemove2_NullPointerException.
/**
* remove(null, x) throws NPE
*/
public void testRemove2_NullPointerException() {
try {
ConcurrentMap c = newMap(5);
c.put("sadsdf", "asdads");
c.remove(null, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
Aggregations