KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > bidimap > TestUnmodifiableSortedBidiMap


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.bidimap;
17
18 import java.util.Map JavaDoc;
19 import java.util.TreeMap JavaDoc;
20
21 import junit.framework.Test;
22 import junit.textui.TestRunner;
23
24 import org.apache.commons.collections.BidiMap;
25 import org.apache.commons.collections.BulkTest;
26 import org.apache.commons.collections.SortedBidiMap;
27
28 /**
29  * JUnit tests.
30  *
31  * @version $Revision: 1.4 $ $Date: 2004/04/09 15:15:18 $
32  *
33  * @author Stephen Colebourne
34  */

35 public class TestUnmodifiableSortedBidiMap extends AbstractTestSortedBidiMap {
36
37     public static void main(String JavaDoc[] args) {
38         TestRunner.run(suite());
39     }
40     
41     public static Test suite() {
42         return BulkTest.makeSuite(TestUnmodifiableSortedBidiMap.class);
43     }
44
45     public TestUnmodifiableSortedBidiMap(String JavaDoc testName) {
46         super(testName);
47     }
48
49     //-----------------------------------------------------------------------
50
public BidiMap makeEmptyBidiMap() {
51         return UnmodifiableSortedBidiMap.decorate(new DualTreeBidiMap());
52     }
53     public BidiMap makeFullBidiMap() {
54         SortedBidiMap bidi = new DualTreeBidiMap();
55         for (int i = 0; i < entries.length; i++) {
56             bidi.put(entries[i][0], entries[i][1]);
57         }
58         return UnmodifiableSortedBidiMap.decorate(bidi);
59     }
60     public Map JavaDoc makeFullMap() {
61         SortedBidiMap bidi = new DualTreeBidiMap();
62         addSampleMappings(bidi);
63         return UnmodifiableSortedBidiMap.decorate(bidi);
64     }
65     
66     public Map JavaDoc makeConfirmedMap() {
67         return new TreeMap JavaDoc();
68     }
69
70     public boolean isSubMapViewsSerializable() {
71         // TreeMap sub map views have a bug in deserialization.
72
return false;
73     }
74     public String JavaDoc[] ignoredTests() {
75         // Override to prevent infinite recursion of tests.
76
return new String JavaDoc[] {"TestUnmodifiableSortedBidiMap.bulkTestInverseMap.bulkTestInverseMap"};
77     }
78
79     //-----------------------------------------------------------------------
80
public boolean isAllowNullKey() {
81         return false;
82     }
83     public boolean isAllowNullValue() {
84         return false;
85     }
86     public boolean isPutAddSupported() {
87         return false;
88     }
89     public boolean isPutChangeSupported() {
90         return false;
91     }
92     public boolean isRemoveSupported() {
93         return false;
94     }
95     
96 }
97
Popular Tags