001    /*
002     *  Copyright 2003-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.convert1.util;
017    
018    import junit.framework.Test;
019    import junit.framework.TestCase;
020    import junit.framework.TestSuite;
021    
022    public class ClassMapTestCase extends TestCase {
023    
024        /**
025         * Construct a new instance of this test case.
026         *
027         * @param name Name of the test case
028         */
029        public ClassMapTestCase(String name) {
030            super(name);
031        }
032    
033        /**
034         * Set up instance variables required by this test case.
035         */
036        public void setUp() {
037            ;    // No action required
038        }
039        
040        /**
041         * Return the tests included in this test suite.
042         */
043        public static Test suite() {
044            return (new TestSuite(ClassMapTestCase.class));
045        }
046        
047        /**
048         * Tear down instance variables required by this test case.
049         */
050        public void tearDown() {
051            ;    // No action required
052        }
053        
054        public void test() {
055    
056            ClassMap map = new ClassMap();
057    
058            map.put( String.class, "STRING" );
059            map.put( Number.class, "NUMBER" );
060            map.put( java.sql.Date.class, "SQL-DATE" );
061            map.put( java.util.Date.class, "UTIL-DATE" );
062    
063            assertEquals( "STRING", map.get( String.class ) );
064            assertEquals( "NUMBER", map.get( Number.class ) );
065            assertEquals( "NUMBER", map.get( Long.class ) );
066            assertEquals( "SQL-DATE", map.get( java.sql.Date.class ) );
067            assertEquals( "UTIL-DATE", map.get( java.util.Date.class ) );
068        }
069        
070    }