亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mappedpropertytestcase.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.beanutils;

import junit.framework.TestCase;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <p>Test Case for the <code>MappedPropertyDescriptor</code>.</p>
 *
 * @author Niall Pemberton
 */
public class MappedPropertyTestCase extends TestCase {

    private static final Log log = LogFactory.getLog(MappedPropertyTestCase.class);


    // ---------------------------------------------------------- Constructors

    /**
     * Construct a new instance of this test case.
     *
     * @param name Name of the test case
     */
    public MappedPropertyTestCase(String name) {
        super(name);
    }

    // -------------------------------------------------- Overall Test Methods

    /**
     * Run this Test
     */
    public static void main(String[] args) {
      junit.textui.TestRunner.run(suite());
    }

    /**
     * Set up instance variables required by this test case.
     */
    public void setUp() throws Exception {
    }

    /**
     * Return the tests included in this test suite.
     */
    public static Test suite() {
        return (new TestSuite(MappedPropertyTestCase.class));
    }

    /**
     * Tear down instance variables required by this test case.
     */
    public void tearDown() {
    }

    // ------------------------------------------------ Individual Test Methods

    /**
     * Test valid method name
     */
    public void testFound() {
        String property = "mapproperty";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test boolean "is" method name
     */
    public void testBooleanMapped() {
        String property = "mappedBoolean";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test invalid method name
     */
    public void testNotFound() {
        String property = "xxxxxxx";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            fail("Property '" + property + "' found in " + clazz.getName());
        } catch (Exception ex) {
            // expected result
        }
    }

    /**
     * Test Mapped Property - Getter only
     */
    public void testMappedGetterOnly() {
        String property = "mappedGetterOnly";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNull("Setter is found", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test Mapped Property - Setter Only
     */
    public void testMappedSetterOnly() {
        String property = "mappedSetterOnly";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNull("Getter is found", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test Mapped Property - Invalid Setter
     */
    public void testInvalidSetter() {
        String property = "invalidSetter";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNull("Setter is found", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test Mapped Property - Invalid Getter
     */
    public void testInvalidGetter() {
        String property = "invalidGetter";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNull("Getter is found", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test Mapped Property - Different Types
     *
     * Expect to find the getDifferentTypes() method, but not
     * the setDifferentTypes() method because setDifferentTypes()
     * sets and Integer, while getDifferentTypes() returns a Long.
     */
    public void testDifferentTypes() {
        String property = "differentTypes";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNull("Setter is found", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test Mpa getter
     */
    public void testMapGetter() {
        MappedPropertyTestBean bean = new MappedPropertyTestBean();
        Class clazz = MappedPropertyTestBean.class;
        String property = "myMap";
        try {
            String testValue = "test value";
            String testKey   = "testKey";
            BeanUtils.setProperty(bean, "myMap("+testKey+")", "test value");
            assertEquals("Map getter", testValue, bean.getMyMap().get(testKey));
        } catch (Exception ex) {
            fail("Test set mapped property failed: " + ex);
        }
    }


    /**
     * Test property with any two args
     */
    public void testAnyArgsProperty() {
        String property = "anyMapped";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNull("Getter is found", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test property with two primitve args
     */
    public void testPrimitiveArgsProperty() {
        String property = "mappedPrimitive";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNull("Getter is found", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test 'protected' mapped property
     */
    public void testProtected() {
        String property = "protectedProperty";
        Class clazz = MappedPropertyTestBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            fail("Property '" + property + "' found in " + clazz.getName());
        } catch (Exception ex) {
            // expected result
        }
    }


    /**
     * Test 'public' method in parent
     */
    public void testPublicParentMethod() {
        String property = "mapproperty";
        Class clazz = MappedPropertyChildBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test 'protected' method in parent
     */
    public void testProtectedParentMethod() {
        String property = "protectedMapped";
        Class clazz = MappedPropertyChildBean.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            fail("Property '" + property + "' found in " + clazz.getName());
        } catch (Exception ex) {
        }
    }


    /**
     * Test Interface with mapped property
     */
    public void testInterfaceMapped() {
        String property = "mapproperty";
        Class clazz = MappedPropertyTestInterface.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }

    /**
     * Test property not found in interface
     */
    public void testInterfaceNotFound() {
        String property = "XXXXXX";
        Class clazz = MappedPropertyTestInterface.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            fail("Property '" + property + "' found in " + clazz.getName());
        } catch (Exception ex) {
        }
    }

    /**
     * Test Interface Inherited mapped property
     */
    public void testChildInterfaceMapped() {
        String property = "mapproperty";
        Class clazz = MappedPropertyChildInterface.class;
        try {
            MappedPropertyDescriptor desc 
                = new MappedPropertyDescriptor(property, clazz);
            assertNotNull("Getter is missing", desc.getMappedReadMethod());
            assertNotNull("Setter is missing", desc.getMappedWriteMethod());
        } catch (Exception ex) {
            fail("Property '" + property + "' Not Found in " + clazz.getName() + ": " + ex);
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91女人视频在线观看| 国产成人福利片| 国产亚洲一区二区三区四区| 暴力调教一区二区三区| 日韩精品一级中文字幕精品视频免费观看| 精品美女在线播放| 欧美日韩久久久久久| 成人动漫av在线| 国精产品一区一区三区mba桃花 | 国产精品1区2区3区在线观看| 综合网在线视频| 久久久精品黄色| 91麻豆精品国产91久久久资源速度| 成人sese在线| 国产一区二区三区香蕉| 日日夜夜一区二区| 亚洲精品日产精品乱码不卡| 国产日韩欧美a| 日韩免费性生活视频播放| 欧美日韩电影在线| 在线观看亚洲专区| 欧美成人女星排行榜| 欧美人狂配大交3d怪物一区| 97aⅴ精品视频一二三区| 国产白丝精品91爽爽久久| 精品影院一区二区久久久| 天天射综合影视| 亚洲国产精品一区二区尤物区| 国产精品国产三级国产| 国产日韩欧美高清在线| 国产亚洲精品超碰| 国产丝袜美腿一区二区三区| 久久一区二区视频| 精品精品国产高清一毛片一天堂| 91麻豆精品国产91久久久更新时间 | 亚洲aaa精品| 亚洲一二三专区| 亚洲一区二区三区视频在线 | av激情亚洲男人天堂| 国产精品正在播放| 国产成人精品aa毛片| 丁香婷婷综合激情五月色| 国产一区二区三区在线观看精品| 国产尤物一区二区| 国产精品资源网| 成人免费视频一区| 91视频免费看| 在线观看一区不卡| 1区2区3区欧美| 一级日本不卡的影视| 亚洲福中文字幕伊人影院| 天天色天天爱天天射综合| 日韩高清中文字幕一区| 国内精品在线播放| 国产成人免费视频精品含羞草妖精| 国产不卡视频一区二区三区| 99久久精品免费看国产| 在线观看日韩毛片| 在线电影院国产精品| 日韩久久精品一区| 国产欧美视频一区二区| 中文字幕一区二区三区四区不卡| 亚洲免费资源在线播放| 亚洲不卡在线观看| 久久99精品久久久久久久久久久久 | 成人av中文字幕| 91国产丝袜在线播放| 欧美日本一区二区三区| 久久综合狠狠综合久久综合88 | 日本一区二区三区四区在线视频 | 国产欧美综合在线观看第十页 | 国产激情91久久精品导航| av在线不卡电影| 欧美疯狂性受xxxxx喷水图片| 欧美sm美女调教| 中文av一区二区| 亚洲成av人片一区二区梦乃| 激情偷乱视频一区二区三区| av爱爱亚洲一区| 欧美一区二区福利视频| 国产天堂亚洲国产碰碰| 亚洲成人一区二区| 国产乱码精品一区二区三区五月婷| 91免费在线播放| 日韩一区二区在线观看视频播放| 国产三级精品三级| 丝袜脚交一区二区| 成人av电影在线网| 日韩精品一区二区三区视频播放| 国产精品综合网| 欧美性一区二区| 久久久久久久久久久久久久久99| 一区二区三区精品视频| 国产精品白丝av| 欧美精品123区| 亚洲视频综合在线| 狠狠色丁香久久婷婷综合丁香| 色狠狠av一区二区三区| 欧美国产综合色视频| 爽好多水快深点欧美视频| av一区二区不卡| 精品国产乱码久久| 无码av免费一区二区三区试看 | 欧美妇女性影城| 亚洲日本欧美天堂| 国产一区视频在线看| 欧美日韩五月天| 亚洲视频图片小说| 国产精品1024| 日韩欧美高清一区| 亚洲福利一区二区| 99re66热这里只有精品3直播| 精品免费国产一区二区三区四区| 亚洲国产视频一区| 91香蕉视频污| 国产精品日韩精品欧美在线| 韩国女主播一区二区三区| 欧美精品久久99久久在免费线| 亚洲同性同志一二三专区| 国产成人在线视频播放| 欧美mv日韩mv亚洲| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产精品三级电影| 国产不卡视频一区| 国产午夜亚洲精品不卡| 国产精品正在播放| 国产午夜精品美女毛片视频| 精品一区精品二区高清| 日韩免费成人网| 九九九久久久精品| 欧美电影免费观看完整版| 免费高清成人在线| 欧美一区二区三区免费在线看 | 亚洲丝袜美腿综合| 91一区二区在线观看| 亚洲欧美一区二区三区极速播放| 97久久精品人人做人人爽| 亚洲天天做日日做天天谢日日欢| 9i在线看片成人免费| 亚洲欧美另类图片小说| 色激情天天射综合网| 亚洲国产精品人人做人人爽| 欧美日韩国产精品自在自线| 午夜视黄欧洲亚洲| 日韩精品一区二区三区视频在线观看| 奇米影视一区二区三区| 欧美精品一区二区三区四区 | 亚洲在线视频免费观看| 在线看一区二区| 日韩国产精品久久久| 亚洲激情自拍偷拍| 欧美日韩中文另类| 蜜臀av性久久久久av蜜臀妖精| 日韩久久久久久| 成人白浆超碰人人人人| 亚洲自拍偷拍麻豆| 欧美一区欧美二区| 国产69精品久久久久777| 亚洲免费观看视频| 666欧美在线视频| 国产又黄又大久久| 亚洲免费观看高清完整版在线| 欧美三级中文字幕| 国产呦精品一区二区三区网站| 国产精品国产精品国产专区不蜜 | 中文字幕一区二区三| 欧美亚洲动漫制服丝袜| 久久成人18免费观看| 国产精品激情偷乱一区二区∴| 欧美主播一区二区三区美女| 午夜精品一区在线观看| 久久亚洲影视婷婷| 日本精品裸体写真集在线观看 | 日韩久久一区二区| 欧美一区二区三区在线电影| 国产剧情一区二区三区| 一区二区三区四区不卡视频| 日韩三级视频在线观看| 99久久精品免费精品国产| 日本aⅴ亚洲精品中文乱码| 国产精品水嫩水嫩| 4438x亚洲最大成人网| 成人免费毛片app| 日韩精品欧美精品| 国产精品的网站| 日韩一区二区免费在线电影| 99久久99久久精品免费看蜜桃| 日本美女一区二区三区| 亚洲欧美另类小说视频| 久久精品欧美一区二区三区麻豆| 欧美丝袜第三区| 粉嫩av一区二区三区在线播放 | 国产婷婷一区二区| 欧美老年两性高潮| 91丝袜美女网| 国产精品一区专区| 人人爽香蕉精品| 亚洲小说欧美激情另类| 欧美极品少妇xxxxⅹ高跟鞋| 日韩免费视频一区|