use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testPutIfAbsent1_NullPointerException.
/**
* putIfAbsent(null, x) throws NPE
*/
@Test
public void testPutIfAbsent1_NullPointerException() {
ConcurrentMap c = makeMap();
try {
c.putIfAbsent(null, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testContainsValue.
/**
* containsValue returns true for held values
*/
@Test
public void testContainsValue() {
ConcurrentMap map = map5();
assertTrue(map.containsValue("A"));
assertFalse(map.containsValue("Z"));
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testPut1_NullPointerException.
/**
* put(null,x) throws NPE
*/
@Test
public void testPut1_NullPointerException() {
ConcurrentMap c = makeMap();
try {
c.put(null, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testPut2_NullPointerException.
/**
* put(x, null) throws NPE
*/
@Test
public void testPut2_NullPointerException() {
ConcurrentMap c = makeMap();
try {
c.put("whatever", null);
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentMap in project mapdb by jankotek.
the class ConcurrentHashMapTest method testGet.
/**
* get returns the correct element at the given key,
* or null if not present
*/
@Test
public void testGet() {
ConcurrentMap map = map5();
assertEquals("A", (String) map.get(one));
ConcurrentMap empty = makeGenericMap();
assertNull(map.get(111111));
assertNull(empty.get(111111111));
}
Aggregations