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