11 |
|
|
12 |
|
public class ConcurrentSkipListSubMapTest extends JSR166TestCase { |
13 |
|
public static void main(String[] args) { |
14 |
< |
junit.textui.TestRunner.run (suite()); |
14 |
> |
junit.textui.TestRunner.run (suite()); |
15 |
|
} |
16 |
|
public static Test suite() { |
17 |
|
return new TestSuite(ConcurrentSkipListSubMapTest.class); |
20 |
|
/** |
21 |
|
* Create a map from Integers 1-5 to Strings "A"-"E". |
22 |
|
*/ |
23 |
< |
private static ConcurrentNavigableMap map5() { |
23 |
> |
private static ConcurrentNavigableMap map5() { |
24 |
|
ConcurrentSkipListMap map = new ConcurrentSkipListMap(); |
25 |
|
assertTrue(map.isEmpty()); |
26 |
|
map.put(zero, "Z"); |
38 |
|
/** |
39 |
|
* Create a map from Integers -5 to -1 to Strings "A"-"E". |
40 |
|
*/ |
41 |
< |
private static ConcurrentNavigableMap dmap5() { |
41 |
> |
private static ConcurrentNavigableMap dmap5() { |
42 |
|
ConcurrentSkipListMap map = new ConcurrentSkipListMap(); |
43 |
|
assertTrue(map.isEmpty()); |
44 |
|
map.put(m1, "A"); |
51 |
|
return map.descendingMap(); |
52 |
|
} |
53 |
|
|
54 |
< |
private static ConcurrentNavigableMap map0() { |
54 |
> |
private static ConcurrentNavigableMap map0() { |
55 |
|
ConcurrentSkipListMap map = new ConcurrentSkipListMap(); |
56 |
|
assertTrue(map.isEmpty()); |
57 |
|
return map.tailMap(one, true); |
58 |
|
} |
59 |
|
|
60 |
< |
private static ConcurrentNavigableMap dmap0() { |
60 |
> |
private static ConcurrentNavigableMap dmap0() { |
61 |
|
ConcurrentSkipListMap map = new ConcurrentSkipListMap(); |
62 |
|
assertTrue(map.isEmpty()); |
63 |
|
return map; |
239 |
|
Iterator it = s.iterator(); |
240 |
|
while (it.hasNext()) { |
241 |
|
Map.Entry e = (Map.Entry) it.next(); |
242 |
< |
assertTrue( |
242 |
> |
assertTrue( |
243 |
|
(e.getKey().equals(one) && e.getValue().equals("A")) || |
244 |
|
(e.getKey().equals(two) && e.getValue().equals("B")) || |
245 |
|
(e.getKey().equals(three) && e.getValue().equals("C")) || |
497 |
|
for (int i = 1; i <= 5; ++i) { |
498 |
|
assertTrue(s.indexOf(String.valueOf(i)) >= 0); |
499 |
|
} |
500 |
< |
} |
500 |
> |
} |
501 |
|
|
502 |
|
// Exception tests |
503 |
|
|
938 |
|
Iterator it = s.iterator(); |
939 |
|
while (it.hasNext()) { |
940 |
|
Map.Entry e = (Map.Entry) it.next(); |
941 |
< |
assertTrue( |
941 |
> |
assertTrue( |
942 |
|
(e.getKey().equals(m1) && e.getValue().equals("A")) || |
943 |
|
(e.getKey().equals(m2) && e.getValue().equals("B")) || |
944 |
|
(e.getKey().equals(m3) && e.getValue().equals("C")) || |
1196 |
|
for (int i = 1; i <= 5; ++i) { |
1197 |
|
assertTrue(s.indexOf(String.valueOf(i)) >= 0); |
1198 |
|
} |
1199 |
< |
} |
1199 |
> |
} |
1200 |
|
|
1201 |
|
// Exception testDescendings |
1202 |
|
|
1460 |
|
assertEquals(3, sm.size()); |
1461 |
|
assertEquals(4, map.size()); |
1462 |
|
} |
1463 |
< |
|
1463 |
> |
|
1464 |
|
} |