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.behaviors;
011
012 import junit.framework.TestCase;
013 import org.picocontainer.testmodel.CoupleBean;
014 import org.picocontainer.behaviors.PropertyApplyingBehavior;
015
016 /**
017 *
018 * @author greg
019 * @author $Author: $ (last edit)
020 * @version $Revision: $
021 */
022 public class PropertyApplyingBehaviorTestCase extends TestCase {
023 public void testBeanPropertyComponentAdapterCanUsePropertyEditors() {
024 Object c = PropertyApplyingBehavior.convert(CoupleBean.class.getName(), "a's name:Camilla;b's name:Charles;", this.getClass().getClassLoader());
025 assertNotNull(c);
026 assertTrue(c instanceof CoupleBean);
027 assertEquals("Camilla", ((CoupleBean) c).getPersonA().getName());
028 assertEquals("Charles", ((CoupleBean) c).getPersonB().getName());
029 }
030
031 }