Search in sources :

Example 66 with ConcurrentSkipListMap

use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.

the class ConcurrentSkipListMapTest method testLowerEntry.

/**
 * lowerEntry returns preceding entry.
 */
public void testLowerEntry() {
    ConcurrentSkipListMap 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 : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) NavigableMap(java.util.NavigableMap) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Map(java.util.Map)

Example 67 with ConcurrentSkipListMap

use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.

the class ConcurrentSkipListMapTest method testLastKey.

/**
 * lastKey returns last key
 */
public void testLastKey() {
    ConcurrentSkipListMap map = map5();
    assertEquals(five, map.lastKey());
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 68 with ConcurrentSkipListMap

use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.

the class ConcurrentSkipListMapTest method testReplaceValue_NullPointerException.

/**
 * replace(null, x, y) throws NPE
 */
public void testReplaceValue_NullPointerException() {
    ConcurrentSkipListMap c = map5();
    try {
        c.replace(null, one, "whatever");
        shouldThrow();
    } catch (NullPointerException success) {
    }
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 69 with ConcurrentSkipListMap

use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.

the class ConcurrentSkipListMapTest method testEquals.

/**
 * Maps with same contents are equal
 */
public void testEquals() {
    ConcurrentSkipListMap map1 = map5();
    ConcurrentSkipListMap map2 = map5();
    assertEquals(map1, map2);
    assertEquals(map2, map1);
    map1.clear();
    assertFalse(map1.equals(map2));
    assertFalse(map2.equals(map1));
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 70 with ConcurrentSkipListMap

use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.

the class ConcurrentSkipListMapTest method testClear.

/**
 * clear removes all pairs
 */
public void testClear() {
    ConcurrentSkipListMap map = map5();
    map.clear();
    assertEquals(0, map.size());
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Aggregations

ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)183 Test (org.junit.Test)66 PollStatus (org.opennms.netmgt.poller.PollStatus)32 MonitoredService (org.opennms.netmgt.poller.MonitoredService)31 Map (java.util.Map)30 ServiceMonitor (org.opennms.netmgt.poller.ServiceMonitor)25 MqttDeviceTwin (com.microsoft.azure.sdk.iot.device.transport.mqtt.MqttDeviceTwin)23 HashMap (java.util.HashMap)21 DeviceTwinMessage (com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceTwinMessage)17 NavigableMap (java.util.NavigableMap)14 Set (java.util.Set)12 Iterator (java.util.Iterator)11 NavigableSet (java.util.NavigableSet)11 MockMonitoredService (org.opennms.netmgt.poller.mock.MockMonitoredService)11 IOException (java.io.IOException)10 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)10 ArrayList (java.util.ArrayList)9 BitSet (java.util.BitSet)9 DeviceOperations (com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceOperations)8 JUnitHttpServer (org.opennms.core.test.http.annotations.JUnitHttpServer)8