01: /*
02: * Copyright 2003-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
19: import java.util.Map;
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: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
30: *
31: * @author Stephen Colebourne
32: */
33: public class TestFixedSizeMap extends AbstractTestMap {
34:
35: public TestFixedSizeMap(String 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 args[]) {
44: String[] testCaseName = { TestFixedSizeMap.class.getName() };
45: junit.textui.TestRunner.main(testCaseName);
46: }
47:
48: public Map makeEmptyMap() {
49: return FixedSizeMap.decorate(new HashMap());
50: }
51:
52: public Map makeFullMap() {
53: Map map = new HashMap();
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 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: }
|