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     */
020    public class ConstantParameterTestCase extends TestCase {
021        
022        /**
023        *  constant parameter with instance type shall verify for expected primitives
024         * @throws Exception
025         */
026        public void testThatInstaceTypeAcceptedForPrimitives() throws Exception {
027            ConstantParameter param = new ConstantParameter(239);
028            try{
029                param.verify(null,null,Integer.TYPE, null);
030            } catch(PicoCompositionException ex) {
031                fail("failed verification for primitive / instance ");
032            }
033        }
034    }