01: /*
02: * Copyright 2001-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.bidimap;
17:
18: import java.util.Map;
19: import java.util.TreeMap;
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: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
32: *
33: * @author Stephen Colebourne
34: */
35: public class TestUnmodifiableOrderedBidiMap extends
36: AbstractTestOrderedBidiMap {
37:
38: public static void main(String[] args) {
39: TestRunner.run(suite());
40: }
41:
42: public static Test suite() {
43: return BulkTest.makeSuite(TestUnmodifiableOrderedBidiMap.class);
44: }
45:
46: public TestUnmodifiableOrderedBidiMap(String testName) {
47: super (testName);
48: }
49:
50: public BidiMap makeEmptyBidiMap() {
51: return UnmodifiableOrderedBidiMap.decorate(new TreeBidiMap());
52: }
53:
54: public BidiMap makeFullBidiMap() {
55: OrderedBidiMap bidi = new TreeBidiMap();
56: for (int i = 0; i < entries.length; i++) {
57: bidi.put(entries[i][0], entries[i][1]);
58: }
59: return UnmodifiableOrderedBidiMap.decorate(bidi);
60: }
61:
62: public Map makeFullMap() {
63: OrderedBidiMap bidi = new TreeBidiMap();
64: addSampleMappings(bidi);
65: return UnmodifiableOrderedBidiMap.decorate(bidi);
66: }
67:
68: public Map makeConfirmedMap() {
69: return new TreeMap();
70: }
71:
72: /**
73: * Override to prevent infinite recursion of tests.
74: */
75: public String[] ignoredTests() {
76: return new String[] { "TestUnmodifiableOrderedBidiMap.bulkTestInverseMap.bulkTestInverseMap" };
77: }
78:
79: public boolean isAllowNullKey() {
80: return false;
81: }
82:
83: public boolean isAllowNullValue() {
84: return false;
85: }
86:
87: public boolean isPutAddSupported() {
88: return false;
89: }
90:
91: public boolean isPutChangeSupported() {
92: return false;
93: }
94:
95: public boolean isRemoveSupported() {
96: return false;
97: }
98:
99: }
|