KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > defaults > ConstantParameterTestCase


1 /*****************************************************************************
2  * Copyright (C) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Original code by *
9  *****************************************************************************/

10 package org.picocontainer.defaults;
11
12 import junit.framework.TestCase;
13 import org.picocontainer.PicoIntrospectionException;
14 /**
15  * test that constant parameter behaves well.
16  * @author Konstantin Pribluda
17  * @version $Revision: 1575 $
18  */

19 public class ConstantParameterTestCase extends TestCase {
20     
21     /**
22     * constant parameter with instance type shall verify for expected primitives
23     */

24     public void testThatInstaceTypeAcceptedForPrimitives() throws Exception JavaDoc {
25         ConstantParameter param = new ConstantParameter(new Integer JavaDoc(239));
26         try{
27             param.verify(null,null,Integer.TYPE);
28         } catch(PicoIntrospectionException ex) {
29             fail("failed verification for primitive / instance ");
30         }
31     }
32 }
33
Popular Tags