use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testCeilingKey.
/**
* ceilingKey returns next element
*/
public void testCeilingKey() {
ConcurrentSkipListMap q = map5();
Object e1 = q.ceilingKey(three);
assertEquals(three, e1);
Object e2 = q.ceilingKey(zero);
assertEquals(one, e2);
Object e3 = q.ceilingKey(five);
assertEquals(five, e3);
Object e4 = q.ceilingKey(six);
assertNull(e4);
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testReplaceValue2.
/**
* replace value succeeds when the given key mapped to expected value
*/
public void testReplaceValue2() {
ConcurrentSkipListMap map = map5();
assertEquals("A", map.get(one));
assertTrue(map.replace(one, "A", "Z"));
assertEquals("Z", map.get(one));
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListSubMapTest method map5.
// android-note: Removed because the CTS runner does a bad job of
// retrying tests that have suite() declarations.
//
// public static void main(String[] args) {
// main(suite(), args);
// }
// public static Test suite() {
// return new TestSuite(ConcurrentSkipListSubMapTest.class);
// }
/**
* Returns a new map from Integers 1-5 to Strings "A"-"E".
*/
private static ConcurrentNavigableMap map5() {
ConcurrentSkipListMap map = new ConcurrentSkipListMap();
assertTrue(map.isEmpty());
map.put(zero, "Z");
map.put(one, "A");
map.put(five, "E");
map.put(three, "C");
map.put(two, "B");
map.put(four, "D");
map.put(seven, "F");
assertFalse(map.isEmpty());
assertEquals(7, map.size());
return map.subMap(one, true, seven, false);
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testLowerKey.
/**
* lowerKey returns preceding element
*/
public void testLowerKey() {
ConcurrentSkipListMap q = map5();
Object e1 = q.lowerKey(three);
assertEquals(two, e1);
Object e2 = q.lowerKey(six);
assertEquals(five, e2);
Object e3 = q.lowerKey(one);
assertNull(e3);
Object e4 = q.lowerKey(zero);
assertNull(e4);
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testGet.
/**
* get returns the correct element at the given key,
* or null if not present
*/
public void testGet() {
ConcurrentSkipListMap map = map5();
assertEquals("A", (String) map.get(one));
ConcurrentSkipListMap empty = new ConcurrentSkipListMap();
assertNull(empty.get(one));
}
Aggregations