001    /*****************************************************************************
002     * Copyright (C) PicoContainer Organization. All rights reserved.            *
003     * ------------------------------------------------------------------------- *
004     * The software in this package is published under the terms of the BSD      *
005     * style license a copy of which has been included with this distribution in *
006     * the LICENSE.txt file.                                                     *
007     *                                                                           *
008     * Original code by                                                          *
009     *****************************************************************************/
010    package org.picocontainer.parameters;
011    
012    import junit.framework.TestCase;
013    import org.picocontainer.PicoCompositionException;
014    import org.picocontainer.parameters.ConstantParameter;
015    
016    /**
017     * test that constant parameter behaves well.
018     * @author Konstantin Pribluda
019     * @version $Revision: 3516 $
020     */
021    public class ConstantParameterTestCase extends TestCase {
022        
023        /**
024        *  constant parameter with instance type shall verify for expected primitives
025         * @throws Exception
026         */
027        public void testThatInstaceTypeAcceptedForPrimitives() throws Exception {
028            ConstantParameter param = new ConstantParameter(239);
029            try{
030                param.verify(null,null,Integer.TYPE, null);
031            } catch(PicoCompositionException ex) {
032                fail("failed verification for primitive / instance ");
033            }
034        }
035    }