KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > map > TestHashedMap


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.collections.map;
17
18 import java.util.Map JavaDoc;
19
20 import junit.framework.Test;
21 import junit.textui.TestRunner;
22
23 import org.apache.commons.collections.BulkTest;
24
25 /**
26  * JUnit tests.
27  *
28  * @version $Revision: 1.7 $ $Date: 2004/02/27 00:25:14 $
29  *
30  * @author Stephen Colebourne
31  */

32 public class TestHashedMap extends AbstractTestIterableMap {
33
34     public TestHashedMap(String JavaDoc testName) {
35         super(testName);
36     }
37
38     public static void main(String JavaDoc[] args) {
39         TestRunner.run(suite());
40     }
41     
42     public static Test suite() {
43         return BulkTest.makeSuite(TestHashedMap.class);
44     }
45
46     public Map JavaDoc makeEmptyMap() {
47         return new HashedMap();
48     }
49     
50     public String JavaDoc getCompatibilityVersion() {
51         return "3";
52     }
53
54     public void testClone() {
55         HashedMap map = new HashedMap(10);
56         map.put("1", "1");
57         Map JavaDoc cloned = (Map JavaDoc) map.clone();
58         assertEquals(map.size(), cloned.size());
59         assertSame(map.get("1"), cloned.get("1"));
60     }
61     
62 // public void testCreate() throws Exception {
63
// resetEmpty();
64
// writeExternalFormToDisk((java.io.Serializable) map, "D:/dev/collections/data/test/HashedMap.emptyCollection.version3.obj");
65
// resetFull();
66
// writeExternalFormToDisk((java.io.Serializable) map, "D:/dev/collections/data/test/HashedMap.fullCollection.version3.obj");
67
// }
68
}
69
Popular Tags