1 |
jsr166 |
1.1 |
/* |
2 |
|
|
* Written by Doug Lea and Martin Buchholz with assistance from |
3 |
|
|
* members of JCP JSR-166 Expert Group and released to the public |
4 |
|
|
* domain, as explained at |
5 |
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
import java.util.HashMap; |
9 |
|
|
import java.util.Map; |
10 |
|
|
|
11 |
|
|
import junit.framework.Test; |
12 |
|
|
|
13 |
|
|
public class HashMapTest extends JSR166TestCase { |
14 |
|
|
public static void main(String[] args) { |
15 |
|
|
main(suite(), args); |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
public static Test suite() { |
19 |
|
|
class Implementation implements MapImplementation { |
20 |
|
|
public Class<?> klazz() { return HashMap.class; } |
21 |
|
|
public Map emptyMap() { return new HashMap(); } |
22 |
|
|
public Object makeKey(int i) { return i; } |
23 |
|
|
public Object makeValue(int i) { return i; } |
24 |
|
|
public boolean isConcurrent() { return false; } |
25 |
|
|
public boolean permitsNullKeys() { return true; } |
26 |
|
|
public boolean permitsNullValues() { return true; } |
27 |
|
|
public boolean supportsSetValue() { return true; } |
28 |
|
|
} |
29 |
|
|
return newTestSuite( |
30 |
|
|
// HashMapTest.class, |
31 |
|
|
MapTest.testSuite(new Implementation())); |
32 |
|
|
} |
33 |
|
|
} |