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 static org.junit.Assert.fail;
013
014 import org.junit.Test;
015 import org.picocontainer.PicoCompositionException;
016
017
018 /**
019 * test that constant parameter behaves well.
020 * @author Konstantin Pribluda
021 */
022 public class ConstantParameterTestCase {
023
024 /**
025 * constant parameter with instance type shall verify for expected primitives
026 * @throws Exception
027 */
028 @Test public void testThatInstaceTypeAcceptedForPrimitives() throws Exception {
029 ConstantParameter param = new ConstantParameter(239);
030 try{
031 param.verify(null,null,Integer.TYPE, null, false, null);
032 } catch(PicoCompositionException ex) {
033 fail("failed verification for primitive / instance ");
034 }
035 }
036 }