Search in sources :

Example 61 with ConcurrentNavigableMap

use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.

the class ConcurrentSkipListSubMapTest method testDescendingContainsKey_NullPointerException.

/**
     * containsKey(null) of empty map throws NPE
     */
@Test
public void testDescendingContainsKey_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.containsKey(null);
        shouldThrow();
    } catch (NullPointerException success) {
    }
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 62 with ConcurrentNavigableMap

use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.

the class ConcurrentSkipListSubMapTest method testDescendingContainsKey.

/**
     * containsKey returns true for contained key
     */
@Test
public void testDescendingContainsKey() {
    ConcurrentNavigableMap map = dmap5();
    assertTrue(map.containsKey(m1));
    assertFalse(map.containsKey(zero));
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 63 with ConcurrentNavigableMap

use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.

the class ConcurrentSkipListSubMapTest method testDescendingReplace_NullPointerException.

/**
     * replace(null, x) throws NPE
     */
@Test
public void testDescendingReplace_NullPointerException() {
    try {
        ConcurrentNavigableMap c = dmap5();
        c.replace(null, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {
    }
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 64 with ConcurrentNavigableMap

use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.

the class ConcurrentSkipListSubMapTest method dmap5.

/**
     * Returns a new map from Integers -5 to -1 to Strings "A"-"E".
     */
protected ConcurrentNavigableMap dmap5() {
    ConcurrentNavigableMap map = emptyMap();
    assertTrue(map.isEmpty());
    map.put(m1, "A");
    map.put(m5, "E");
    map.put(m3, "C");
    map.put(m2, "B");
    map.put(m4, "D");
    assertFalse(map.isEmpty());
    assertEquals(5, map.size());
    return map.descendingMap();
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap)

Example 65 with ConcurrentNavigableMap

use of java.util.concurrent.ConcurrentNavigableMap in project mapdb by jankotek.

the class ConcurrentSkipListSubMapTest method testContainsKey_NullPointerException.

/**
     * containsKey(null) of nonempty map throws NPE
     */
@Test
public void testContainsKey_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.containsKey(null);
        shouldThrow();
    } catch (NullPointerException success) {
    }
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Aggregations

ConcurrentNavigableMap (java.util.concurrent.ConcurrentNavigableMap)156 Test (org.junit.Test)147 SortedMap (java.util.SortedMap)25 Map (java.util.Map)19 NavigableMap (java.util.NavigableMap)19 Iterator (java.util.Iterator)12 Set (java.util.Set)10 Collection (java.util.Collection)4 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)4 Update (co.cask.cdap.data2.dataset2.lib.table.Update)3 ArrayList (java.util.ArrayList)2 IncrementValue (co.cask.cdap.data2.dataset2.lib.table.IncrementValue)1 PutValue (co.cask.cdap.data2.dataset2.lib.table.PutValue)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 HashMap (java.util.HashMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1