Search in sources :

Example 66 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testDescendingContainsValue.

/**
     * containsValue returns true for held values
     */
@Test
public void testDescendingContainsValue() {
    ConcurrentNavigableMap map = dmap5();
    assertTrue(map.containsValue("A"));
    assertFalse(map.containsValue("Z"));
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 67 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testReplace_NullPointerException.

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

Example 68 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testContainsValue.

/**
     * containsValue returns true for held values
     */
@Test
public void testContainsValue() {
    ConcurrentNavigableMap map = map5();
    assertTrue(map.containsValue("A"));
    assertFalse(map.containsValue("Z"));
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 69 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testDescendingFirstKey.

/**
     * firstKey returns first key
     */
@Test
public void testDescendingFirstKey() {
    ConcurrentNavigableMap map = dmap5();
    assertEquals(m1, map.firstKey());
}
Also used : ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Test(org.junit.Test)

Example 70 with ConcurrentNavigableMap

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

the class ConcurrentSkipListSubMapTest method testDescendingHigherEntry.

/**
     * higherEntry returns next entry.
     */
@Test
public void testDescendingHigherEntry() {
    ConcurrentNavigableMap map = dmap5();
    Map.Entry e1 = map.higherEntry(m3);
    assertEquals(m4, e1.getKey());
    Map.Entry e2 = map.higherEntry(zero);
    assertEquals(m1, e2.getKey());
    Map.Entry e3 = map.higherEntry(m5);
    assertNull(e3);
    Map.Entry e4 = map.higherEntry(m6);
    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)

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