Search in sources :

Example 61 with ConcurrentSkipListMap

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

the class ConcurrentSkipListMapTest method testValues.

/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentSkipListMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Collection(java.util.Collection)

Example 62 with ConcurrentSkipListMap

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

the class ConcurrentSkipListMapTest method testFloorKey.

/**
 * floorKey returns preceding element
 */
public void testFloorKey() {
    ConcurrentSkipListMap q = map5();
    Object e1 = q.floorKey(three);
    assertEquals(three, e1);
    Object e2 = q.floorKey(six);
    assertEquals(five, e2);
    Object e3 = q.floorKey(one);
    assertEquals(one, e3);
    Object e4 = q.floorKey(zero);
    assertNull(e4);
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 63 with ConcurrentSkipListMap

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

the class ConcurrentSkipListMapTest method testFirstKey.

/**
 * firstKey returns first key
 */
public void testFirstKey() {
    ConcurrentSkipListMap map = map5();
    assertEquals(one, map.firstKey());
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 64 with ConcurrentSkipListMap

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

the class ConcurrentSkipListMapTest method testDescendingEntrySet.

/**
 * descendingEntrySet contains all pairs
 */
public void testDescendingEntrySet() {
    ConcurrentSkipListMap map = map5();
    Set s = map.descendingMap().entrySet();
    assertEquals(5, s.size());
    Iterator it = s.iterator();
    while (it.hasNext()) {
        Map.Entry e = (Map.Entry) it.next();
        assertTrue((e.getKey().equals(one) && e.getValue().equals("A")) || (e.getKey().equals(two) && e.getValue().equals("B")) || (e.getKey().equals(three) && e.getValue().equals("C")) || (e.getKey().equals(four) && e.getValue().equals("D")) || (e.getKey().equals(five) && e.getValue().equals("E")));
    }
}
Also used : ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Set(java.util.Set) NavigableSet(java.util.NavigableSet) BitSet(java.util.BitSet) Iterator(java.util.Iterator) NavigableMap(java.util.NavigableMap) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Map(java.util.Map)

Example 65 with ConcurrentSkipListMap

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

the class ConcurrentSkipListMapTest method testConstructFromSorted.

/**
 * copy constructor creates map equal to source map
 */
public void testConstructFromSorted() {
    ConcurrentSkipListMap map = map5();
    ConcurrentSkipListMap map2 = new ConcurrentSkipListMap(map);
    assertEquals(map, map2);
}
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