Search in sources :

Example 71 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testDescendingPut1_NullPointerException.

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

Example 72 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testLowerEntry.

/**
     * lowerEntry returns preceding entry.
     */
@Test
public void testLowerEntry() {
    ConcurrentNavigableMap map = map5();
    Map.Entry e1 = map.lowerEntry(three);
    assertEquals(two, e1.getKey());
    Map.Entry e2 = map.lowerEntry(six);
    assertEquals(five, e2.getKey());
    Map.Entry e3 = map.lowerEntry(one);
    assertNull(e3);
    Map.Entry e4 = map.lowerEntry(zero);
    assertNull(e4);
}
Also used : Map(java.util.Map) ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) NavigableMap(java.util.NavigableMap) SortedMap(java.util.SortedMap) ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 73 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testContainsKey.

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

Example 74 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testClear.

/**
     * clear removes all pairs
     */
@Test
public void testClear() {
    if (isReadOnly())
        return;
    ConcurrentNavigableMap map = map5();
    map.clear();
    assertEquals(0, map.size());
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 75 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testRemove1_NullPointerException.

/**
     * remove(null) throws NPE
     */
@Test
public void testRemove1_NullPointerException() {
    try {
        ConcurrentNavigableMap c = map5();
        c.remove(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