1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17 package org.apache.commons.collections.bidimap;
18 
19 import java.util.Map;
20 import java.util.TreeMap;
21 
22 import junit.framework.Test;
23 import junit.textui.TestRunner;
24 
25 import org.apache.commons.collections.BidiMap;
26 import org.apache.commons.collections.BulkTest;
27 import org.apache.commons.collections.OrderedBidiMap;
28 
29 /**
30  * JUnit tests.
31  *
32  * @version $Revision: 646780 $ $Date: 2008-04-10 14:48:07 +0200 (Thu, 10 Apr 2008) $
33  *
34  * @author Stephen Colebourne
35  */
36 public class TestUnmodifiableOrderedBidiMap extends AbstractTestOrderedBidiMap {
37 
main(String[] args)38     public static void main(String[] args) {
39         TestRunner.run(suite());
40     }
41 
suite()42     public static Test suite() {
43         return BulkTest.makeSuite(TestUnmodifiableOrderedBidiMap.class);
44     }
45 
TestUnmodifiableOrderedBidiMap(String testName)46     public TestUnmodifiableOrderedBidiMap(String testName) {
47         super(testName);
48     }
49 
makeEmptyBidiMap()50     public BidiMap makeEmptyBidiMap() {
51         return UnmodifiableOrderedBidiMap.decorate(new TreeBidiMap());
52     }
makeFullBidiMap()53     public BidiMap makeFullBidiMap() {
54         OrderedBidiMap bidi = new TreeBidiMap();
55         for (int i = 0; i < entries.length; i++) {
56             bidi.put(entries[i][0], entries[i][1]);
57         }
58         return UnmodifiableOrderedBidiMap.decorate(bidi);
59     }
makeFullMap()60     public Map makeFullMap() {
61         OrderedBidiMap bidi = new TreeBidiMap();
62         addSampleMappings(bidi);
63         return UnmodifiableOrderedBidiMap.decorate(bidi);
64     }
65 
makeConfirmedMap()66     public Map makeConfirmedMap() {
67         return new TreeMap();
68     }
69 
70     /**
71      * Override to prevent infinite recursion of tests.
72      */
ignoredTests()73     public String[] ignoredTests() {
74         return new String[] {"TestUnmodifiableOrderedBidiMap.bulkTestInverseMap.bulkTestInverseMap"};
75     }
76 
isAllowNullKey()77     public boolean isAllowNullKey() {
78         return false;
79     }
isAllowNullValue()80     public boolean isAllowNullValue() {
81         return false;
82     }
isPutAddSupported()83     public boolean isPutAddSupported() {
84         return false;
85     }
isPutChangeSupported()86     public boolean isPutChangeSupported() {
87         return false;
88     }
isRemoveSupported()89     public boolean isRemoveSupported() {
90         return false;
91     }
92 
93 }
94