KickJava   Java API By Example, From Geeks To Geeks.

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


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.Map JavaDoc;
19 import java.util.SortedMap JavaDoc;
20 import java.util.TreeMap JavaDoc;
21
22 import junit.framework.Test;
23
24 import org.apache.commons.collections.BulkTest;
25
26 /**
27  * Extension of {@link TestSortedMap} for exercising the {@link FixedSizeSortedMap}
28  * implementation.
29  *
30  * @since Commons Collections 3.0
31  * @version $Revision: 1.7 $ $Date: 2004/04/09 09:40:15 $
32  *
33  * @author Stephen Colebourne
34  */

35 public class TestFixedSizeSortedMap extends AbstractTestSortedMap {
36
37     public TestFixedSizeSortedMap(String JavaDoc testName) {
38         super(testName);
39     }
40
41     public static Test suite() {
42         return BulkTest.makeSuite(TestFixedSizeSortedMap.class);
43     }
44
45     public static void main(String JavaDoc args[]) {
46         String JavaDoc[] testCaseName = { TestFixedSizeSortedMap.class.getName()};
47         junit.textui.TestRunner.main(testCaseName);
48     }
49
50     //-----------------------------------------------------------------------
51
public Map JavaDoc makeEmptyMap() {
52         return FixedSizeSortedMap.decorate(new TreeMap JavaDoc());
53     }
54
55     public Map JavaDoc makeFullMap() {
56         SortedMap JavaDoc map = new TreeMap JavaDoc();
57         addSampleMappings(map);
58         return FixedSizeSortedMap.decorate(map);
59     }
60     
61     public boolean isSubMapViewsSerializable() {
62         // TreeMap sub map views have a bug in deserialization.
63
return false;
64     }
65
66     public boolean isPutAddSupported() {
67         return false;
68     }
69
70     public boolean isRemoveSupported() {
71         return false;
72     }
73
74     //-----------------------------------------------------------------------
75
public String JavaDoc getCompatibilityVersion() {
76         return "3.1";
77     }
78     
79 // public void testCreate() throws Exception {
80
// resetEmpty();
81
// writeExternalFormToDisk(
82
// (java.io.Serializable) map,
83
// "D:/dev/collections/data/test/FixedSizeSortedMap.emptyCollection.version3.1.obj");
84
// resetFull();
85
// writeExternalFormToDisk(
86
// (java.io.Serializable) map,
87
// "D:/dev/collections/data/test/FixedSizeSortedMap.fullCollection.version3.1.obj");
88
// }
89
}
90
Popular Tags