use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testDescendingPollFirstEntry.
/**
* pollFirstEntry returns entries in order
*/
@Test
public void testDescendingPollFirstEntry() {
if (isReadOnly())
return;
ConcurrentNavigableMap map = dmap5();
Map.Entry e = map.pollFirstEntry();
assertEquals(m1, e.getKey());
assertEquals("A", e.getValue());
e = map.pollFirstEntry();
assertEquals(m2, e.getKey());
map.put(m1, "A");
e = map.pollFirstEntry();
assertEquals(m1, e.getKey());
assertEquals("A", e.getValue());
e = map.pollFirstEntry();
assertEquals(m3, e.getKey());
map.remove(m4);
e = map.pollFirstEntry();
assertEquals(m5, e.getKey());
try {
e.setValue("A");
shouldThrow();
} catch (UnsupportedOperationException success) {
}
e = map.pollFirstEntry();
assertNull(e);
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testDescendingClear.
/**
* clear removes all pairs
*/
@Test
public void testDescendingClear() {
if (isReadOnly())
return;
ConcurrentNavigableMap map = dmap5();
map.clear();
assertEquals(0, map.size());
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testDescendingReplaceValue_NullPointerException.
/**
* replace(null, x, y) throws NPE
*/
@Test
public void testDescendingReplaceValue_NullPointerException() {
if (isReadOnly())
return;
try {
ConcurrentNavigableMap c = dmap5();
c.replace(null, m1, "whatever");
shouldThrow();
} catch (NullPointerException success) {
}
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testHigherEntry.
/**
* higherEntry returns next entry.
*/
@Test
public void testHigherEntry() {
ConcurrentNavigableMap map = map5();
Map.Entry e1 = map.higherEntry(three);
assertEquals(four, e1.getKey());
Map.Entry e2 = map.higherEntry(zero);
assertEquals(one, e2.getKey());
Map.Entry e3 = map.higherEntry(five);
assertNull(e3);
Map.Entry e4 = map.higherEntry(six);
assertNull(e4);
}
use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.
the class ConcurrentSkipListSubMapTest method testContainsValue_NullPointerException.
/**
* containsValue(null) throws NPE
*/
@Test
public void testContainsValue_NullPointerException() {
try {
ConcurrentNavigableMap c = map0();
c.containsValue(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
Aggregations