KickJava   Java API By Example, From Geeks To Geeks.

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


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.OrderedBidiMap;
27
28 /**
29  * JUnit tests.
30  *
31  * @version $Revision: 1.3 $ $Date: 2004/02/18 01:20:40 $
32  *
33  * @author Stephen Colebourne
34  */

35 public class TestUnmodifiableOrderedBidiMap extends AbstractTestOrderedBidiMap {
36
37     public static void main(String JavaDoc[] args) {
38         TestRunner.run(suite());
39     }
40     
41     public static Test suite() {
42         return BulkTest.makeSuite(TestUnmodifiableOrderedBidiMap.class);
43     }
44
45     public TestUnmodifiableOrderedBidiMap(String JavaDoc testName) {
46         super(testName);
47     }
48
49     public BidiMap makeEmptyBidiMap() {
50         return UnmodifiableOrderedBidiMap.decorate(new TreeBidiMap());
51     }
52     public BidiMap makeFullBidiMap() {
53         OrderedBidiMap bidi = new TreeBidiMap();
54         for (int i = 0; i < entries.length; i++) {
55             bidi.put(entries[i][0], entries[i][1]);
56         }
57         return UnmodifiableOrderedBidiMap.decorate(bidi);
58     }
59     public Map JavaDoc makeFullMap() {
60         OrderedBidiMap bidi = new TreeBidiMap();
61         addSampleMappings(bidi);
62         return UnmodifiableOrderedBidiMap.decorate(bidi);
63     }
64     
65     public Map JavaDoc makeConfirmedMap() {
66         return new TreeMap JavaDoc();
67     }
68
69     /**
70      * Override to prevent infinite recursion of tests.
71      */

72     public String JavaDoc[] ignoredTests() {
73         return new String JavaDoc[] {"TestUnmodifiableOrderedBidiMap.bulkTestInverseMap.bulkTestInverseMap"};
74     }
75     
76     public boolean isAllowNullKey() {
77         return false;
78     }
79     public boolean isAllowNullValue() {
80         return false;
81     }
82     public boolean isPutAddSupported() {
83         return false;
84     }
85     public boolean isPutChangeSupported() {
86         return false;
87     }
88     public boolean isRemoveSupported() {
89         return false;
90     }
91     
92 }
93
Popular Tags