@@ -0,0 +1,3215 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.commons.beanutils.locale;%0A%0Aimport junit.framework.TestCase;%0Aimport junit.framework.Test;%0Aimport junit.framework.TestSuite;%0A%0Aimport org.apache.commons.beanutils.TestBean;%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0A%0A/**%0A * Test Case for %7B@link LocaleBeanUtils%7D.%0A *%0A * @version $Revision$ $Date$%0A */%0Apublic class LocaleBeanUtilsTestCase extends TestCase %7B%0A    %0A    private static Log log = LogFactory.getLog(LocaleBeanUtilsTestCase.class);%0A    %0A    /**%0A     * Construct a new instance of this test case.%0A     *%0A     * @param name Name of the test case%0A     */%0A    public LocaleBeanUtilsTestCase(String name) %7B%0A        super(name);%0A    %7D%0A%0A%0A    // -------------------------------------------------- Overall Test Methods%0A%0A%0A    /**%0A     * Set up instance variables required by this test case.%0A     */%0A    public void setUp() %7B%0A    %7D%0A%0A%0A    /**%0A     * Return the tests included in this test suite.%0A     * @return Test Suite%0A     */%0A    public static Test suite() %7B%0A        return (new TestSuite(LocaleBeanUtilsTestCase.class));%0A    %7D%0A%0A%0A    /**%0A     * Tear down instance variables required by this test case.%0A     */%0A    public void tearDown() %7B%0A    %7D%0A%0A%0A    // ------------------------------------------------ Individual Test Methods%0A%0A    /**%0A     * Test setting a nested simple property%0A     */%0A    public void testSetNestedPropertySimple() %7B%0A        TestBean bean = new TestBean();%0A        bean.getNested().setIntProperty(5);%0A        assertEquals(%22Initial value 5%22, 5, bean.getNested().getIntProperty());%0A        try %7B%0A            LocaleBeanUtils.setProperty(bean, %22nested.intProperty%22, %22123%22, null);%0A        %7D catch (Throwable t) %7B%0A            log.error(t);%0A            fail(%22Threw %22 + t);%0A        %7D%0A        assertEquals(%22Check Set Value%22, 123, bean.getNested().getIntProperty());%0A    %7D%0A%0A    /**%0A     * Test setting a nested indexed property%0A     */%0A    public void testSetNestedPropertyIndexed() %7B%0A        TestBean bean = new TestBean();%0A        bean.getNested().setIntIndexed(1, 51);%0A        assertEquals(%22Initial value%5B1%5D 51%22, 51, bean.getNested().getIntIndexed(1));%0A        try %7B%0A            LocaleBeanUtils.setProperty(bean, %22nested.intIndexed%5B1%5D%22, %22123%22, null);%0A        %7D catch (Throwable t) %7B%0A            log.error(t);%0A            fail(%22Threw %22 + t);%0A        %7D%0A        assertEquals(%22Check Set Value%22, 123, bean.getNested().getIntIndexed(1));%0A    %7D%0A%7D%0A%0A

Add test for BEANUTILS-140 - LocaleBeanUtils setProperty does not work on nested property - reposted by Marco La Porta