KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright 2003-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.HashMap JavaDoc;
19 import java.util.Map JavaDoc;
20
21 import junit.framework.Test;
22 import junit.framework.TestSuite;
23
24 /**
25  * Extension of {@link AbstractTestMap} for exercising the {@link FixedSizeMap}
26  * implementation.
27  *
28  * @since Commons Collections 3.0
29  * @version $Revision: 1.6 $ $Date: 2004/04/02 21:15:05 $
30  *
31  * @author Stephen Colebourne
32  */

33 public class TestFixedSizeMap extends AbstractTestMap {
34
35     public TestFixedSizeMap(String JavaDoc testName) {
36         super(testName);
37     }
38
39     public static Test suite() {
40         return new TestSuite(TestFixedSizeMap.class);
41     }
42
43     public static void main(String JavaDoc args[]) {
44         String JavaDoc[] testCaseName = { TestFixedSizeMap.class.getName()};
45         junit.textui.TestRunner.main(testCaseName);
46     }
47
48     public Map JavaDoc makeEmptyMap() {
49         return FixedSizeMap.decorate(new HashMap JavaDoc());
50     }
51
52     public Map JavaDoc makeFullMap() {
53         Map JavaDoc map = new HashMap JavaDoc();
54         addSampleMappings(map);
55         return FixedSizeMap.decorate(map);
56     }
57     
58     public boolean isPutAddSupported() {
59         return false;
60     }
61
62     public boolean isRemoveSupported() {
63         return false;
64     }
65
66     public String JavaDoc getCompatibilityVersion() {
67         return "3.1";
68     }
69
70 // public void testCreate() throws Exception {
71
// resetEmpty();
72
// writeExternalFormToDisk(
73
// (java.io.Serializable) map,
74
// "D:/dev/collections/data/test/FixedSizeMap.emptyCollection.version3.1.obj");
75
// resetFull();
76
// writeExternalFormToDisk(
77
// (java.io.Serializable) map,
78
// "D:/dev/collections/data/test/FixedSizeMap.fullCollection.version3.1.obj");
79
// }
80
}
81
Popular Tags