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.PropertyApplicator;
015
016 /**
017 *
018 * @author greg
019 */
020 public class PropertyApplyingBehaviorTestCase extends TestCase {
021 public void testBeanPropertyComponentAdapterCanUsePropertyEditors() {
022 Object c = PropertyApplicator.convert(CoupleBean.class.getName(), "a's name:Camilla;b's name:Charles;", this.getClass().getClassLoader());
023 assertNotNull(c);
024 assertTrue(c instanceof CoupleBean);
025 assertEquals("Camilla", ((CoupleBean) c).getPersonA().getName());
026 assertEquals("Charles", ((CoupleBean) c).getPersonB().getName());
027 }
028
029 }