use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testDescendingKeySet.
/**
* keySet returns a Set containing all the keys
*/
@Test
public void testDescendingKeySet() {
ConcurrentNavigableMap map = dmap5();
Set s = map.keySet();
assertEquals(5, s.size());
assertTrue(s.contains(m1));
assertTrue(s.contains(m2));
assertTrue(s.contains(m3));
assertTrue(s.contains(m4));
assertTrue(s.contains(m5));
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testRemove2_NullPointerException.
/**
* remove(null, x) throws NPE
*/
@Test
public void testRemove2_NullPointerException() {
try {
ConcurrentNavigableMap c = map5();
c.remove(null, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testEquals.
/**
* Maps with same contents are equal
*/
@Test
public void testEquals() {
ConcurrentNavigableMap map1 = map5();
ConcurrentNavigableMap map2 = map5();
assertEquals(map1, map2);
assertEquals(map2, map1);
if (isReadOnly())
return;
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testDescendingEquals.
/**
* Maps with same contents are equal
*/
@Test
public void testDescendingEquals() {
ConcurrentNavigableMap map1 = dmap5();
ConcurrentNavigableMap map2 = dmap5();
assertEquals(map1, map2);
assertEquals(map2, map1);
if (isReadOnly())
return;
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListMapTest method testLowerKey.
/**
* lowerKey returns preceding element
*/
@Test
public void testLowerKey() {
ConcurrentNavigableMap q = map5();
Object e1 = q.lowerKey(three);
assertEquals(two, e1);
Object e2 = q.lowerKey(six);
assertEquals(five, e2);
Object e3 = q.lowerKey(one);
assertNull(e3);
Object e4 = q.lowerKey(zero);
assertNull(e4);
}
Aggregations