001: /*
002: * Copyright 2001-2004 The Apache Software Foundation
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.commons.collections.bidimap;
017:
018: import java.util.Map;
019: import java.util.TreeMap;
020:
021: import junit.framework.Test;
022: import junit.textui.TestRunner;
023:
024: import org.apache.commons.collections.BidiMap;
025: import org.apache.commons.collections.BulkTest;
026: import org.apache.commons.collections.SortedBidiMap;
027:
028: /**
029: * JUnit tests.
030: *
031: * @version $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
032: *
033: * @author Stephen Colebourne
034: */
035: public class TestUnmodifiableSortedBidiMap extends
036: AbstractTestSortedBidiMap {
037:
038: public static void main(String[] args) {
039: TestRunner.run(suite());
040: }
041:
042: public static Test suite() {
043: return BulkTest.makeSuite(TestUnmodifiableSortedBidiMap.class);
044: }
045:
046: public TestUnmodifiableSortedBidiMap(String testName) {
047: super (testName);
048: }
049:
050: //-----------------------------------------------------------------------
051: public BidiMap makeEmptyBidiMap() {
052: return UnmodifiableSortedBidiMap
053: .decorate(new DualTreeBidiMap());
054: }
055:
056: public BidiMap makeFullBidiMap() {
057: SortedBidiMap bidi = new DualTreeBidiMap();
058: for (int i = 0; i < entries.length; i++) {
059: bidi.put(entries[i][0], entries[i][1]);
060: }
061: return UnmodifiableSortedBidiMap.decorate(bidi);
062: }
063:
064: public Map makeFullMap() {
065: SortedBidiMap bidi = new DualTreeBidiMap();
066: addSampleMappings(bidi);
067: return UnmodifiableSortedBidiMap.decorate(bidi);
068: }
069:
070: public Map makeConfirmedMap() {
071: return new TreeMap();
072: }
073:
074: public boolean isSubMapViewsSerializable() {
075: // TreeMap sub map views have a bug in deserialization.
076: return false;
077: }
078:
079: public String[] ignoredTests() {
080: // Override to prevent infinite recursion of tests.
081: return new String[] { "TestUnmodifiableSortedBidiMap.bulkTestInverseMap.bulkTestInverseMap" };
082: }
083:
084: //-----------------------------------------------------------------------
085: public boolean isAllowNullKey() {
086: return false;
087: }
088:
089: public boolean isAllowNullValue() {
090: return false;
091: }
092:
093: public boolean isPutAddSupported() {
094: return false;
095: }
096:
097: public boolean isPutChangeSupported() {
098: return false;
099: }
100:
101: public boolean isRemoveSupported() {
102: return false;
103: }
104:
105: }
|