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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? beanpropertyvaluechangeclosuretestcase.java

?? 這是一個(gè)有關(guān)common beanutils 的源碼
?? JAVA
字號(hào):
/*
 * 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;


/**
 * Test cases for <code>BeanPropertyValueChangeClosure</code>.
 *
 * @author Norm Deane
 */
public class BeanPropertyValueChangeClosureTestCase extends TestCase {
   
    private static final Integer expectedIntegerValue = new Integer(123);
    private static final Float expectedFloatValue = new Float(123.123f);
    private static final Double expectedDoubleValue = new Double(567879.12344d);
    private static final Boolean expectedBooleanValue = Boolean.TRUE;
    private static final Byte expectedByteValue = new Byte("12");

    /**
     * Constructor for BeanPropertyValueChangeClosureTest.
     *
     * @param name Name of this test case.
     */
    public BeanPropertyValueChangeClosureTestCase(String name) {
        super(name);
    }
    
    /**
     * Test execute with simple float property and Float value.
     */
    public void testExecuteWithSimpleFloatPropertyAndFloatValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("floatProperty", expectedFloatValue).execute(testBean);
        assertTrue(expectedFloatValue.floatValue() == testBean.getFloatProperty());
    }

    /**
     * Test execute with simple float property and String value.
     */
    public void testExecuteWithSimpleFloatPropertyAndStringValue() {
        try {
            new BeanPropertyValueChangeClosure("floatProperty", "123").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple float property and Double value.
     */
    public void testExecuteWithSimpleFloatPropertyAndDoubleValue() {
        try {
            new BeanPropertyValueChangeClosure("floatProperty", expectedDoubleValue).execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple float property and Integer value.
     */
    public void testExecuteWithSimpleFloatPropertyAndIntegerValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("floatProperty", expectedIntegerValue).execute(testBean);
        assertTrue(expectedIntegerValue.floatValue() == testBean.getFloatProperty());
    }

    /**
     * Test execute with simple double property and Double value.
     */
    public void testExecuteWithSimpleDoublePropertyAndDoubleValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("doubleProperty", expectedDoubleValue).execute(testBean);
        assertTrue(expectedDoubleValue.doubleValue() == testBean.getDoubleProperty());
    }

    /**
     * Test execute with simple double property and String value.
     */
    public void testExecuteWithSimpleDoublePropertyAndStringValue() {
        try {
            new BeanPropertyValueChangeClosure("doubleProperty", "123").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple double property and Float value.
     */
    public void testExecuteWithSimpleDoublePropertyAndFloatValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("doubleProperty", expectedFloatValue).execute(testBean);
        assertTrue(expectedFloatValue.doubleValue() == testBean.getDoubleProperty());
    }

    /**
     * Test execute with simple double property and Integer value.
     */
    public void testExecuteWithSimpleDoublePropertyAndIntegerValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("doubleProperty", expectedIntegerValue).execute(testBean);
        assertTrue(expectedIntegerValue.doubleValue() == testBean.getDoubleProperty());
    }

    /**
     * Test execute with simple int property and Double value.
     */
    public void testExecuteWithSimpleIntPropertyAndDoubleValue() {
        try {
            new BeanPropertyValueChangeClosure("intProperty", expectedDoubleValue).execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple int property and String value.
     */
    public void testExecuteWithSimpleIntPropertyAndStringValue() {
        try {
            new BeanPropertyValueChangeClosure("intProperty", "123").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple int property and Float value.
     */
    public void testExecuteWithSimpleIntPropertyAndFloatValue() {
        try {
            new BeanPropertyValueChangeClosure("intProperty", expectedFloatValue).execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple int property and Integer value.
     */
    public void testExecuteWithSimpleIntPropertyAndIntegerValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("intProperty", expectedIntegerValue).execute(testBean);
        assertTrue(expectedIntegerValue.intValue() == testBean.getIntProperty());
    }

    /**
     * Test execute with simple boolean property and Boolean value.
     */
    public void testExecuteWithSimpleBooleanPropertyAndBooleanValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("booleanProperty", expectedBooleanValue).execute(testBean);
        assertTrue(expectedBooleanValue.booleanValue() == testBean.getBooleanProperty());
    }

    /**
     * Test execute with simple boolean property and String value.
     */
    public void testExecuteWithSimpleBooleanPropertyAndStringValue() {
        try {
            new BeanPropertyValueChangeClosure("booleanProperty", "true").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple byte property and Byte value.
     */
    public void testExecuteWithSimpleBytePropertyAndByteValue() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("byteProperty", expectedByteValue).execute(testBean);
        assertTrue(expectedByteValue.byteValue() == testBean.getByteProperty());
    }

    /**
     * Test execute with simple boolean property and String value.
     */
    public void testExecuteWithSimpleBytePropertyAndStringValue() {
        try {
            new BeanPropertyValueChangeClosure("byteProperty", "foo").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with simple primitive property and null value.
     */
    public void testExecuteWithSimplePrimitivePropertyAndNullValue() {
        try {
            new BeanPropertyValueChangeClosure("intProperty", null).execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (NullPointerException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with read only property.
     */
    public void testExecuteWithReadOnlyProperty() {
        try {
            new BeanPropertyValueChangeClosure("readOnlyProperty", "foo").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with write only property.
     */
    public void testExecuteWithWriteOnlyProperty() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("writeOnlyProperty", "foo").execute(testBean);
        assertEquals("foo", testBean.getWriteOnlyPropertyValue());
    }

    /**
     * Test execute with a nested property.
     */
    public void testExecuteWithNestedProperty() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("nested.stringProperty", "bar").execute(testBean);
        assertEquals("bar", testBean.getNested().getStringProperty());
    }

    /**
     * Test execute with a nested property and null in the property path.
     */
    public void testExecuteWithNullInPropertyPath() {
        try {
            new BeanPropertyValueChangeClosure("anotherNested.stringProperty", "foo").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }

    /**
     * Test execute with a nested property and null in the property path and ignoreNull = true.
     */
    public void testExecuteWithNullInPropertyPathAngIgnoreTrue() {
        TestBean testBean = new TestBean();

        // create a closure that will attempt to set a property on the null bean in the path
        BeanPropertyValueChangeClosure closure = new BeanPropertyValueChangeClosure("anotherNested.stringProperty",
                "Should ignore exception", true);

        try {
            closure.execute(testBean);
        } catch (IllegalArgumentException e) {
            fail("Should have ignored the exception.");
        }
    }

    /**
     * Test execute with indexed property.
     */
    public void testExecuteWithIndexedProperty() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("intIndexed[0]", expectedIntegerValue).execute(testBean);
        assertTrue(expectedIntegerValue.intValue() == testBean.getIntIndexed(0));
    }

    /**
     * Test execute with mapped property.
     */
    public void testExecuteWithMappedProperty() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("mappedProperty(fred)", "barney").execute(testBean);
        assertEquals("barney", testBean.getMappedProperty("fred"));
    }

    /**
     * Test execute with a simple String property.
     */
    public void testExecuteWithSimpleStringProperty() {
        TestBean testBean = new TestBean();
        new BeanPropertyValueChangeClosure("stringProperty", "barney").execute(testBean);
        assertEquals("barney", testBean.getStringProperty());
    }

    /**
     * Test execute with an invalid property name.
     */
    public void testExecuteWithInvalidPropertyName() {
        try {
            new BeanPropertyValueChangeClosure("bogusProperty", "foo").execute(new TestBean());
            fail("Should have thrown an IllegalArgumentException");
        } catch (IllegalArgumentException e) { 
            /* this is what we expect */
        }
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品2019中文字幕之3| 亚洲免费观看高清完整版在线观看| 91精品婷婷国产综合久久竹菊| 色婷婷久久综合| 色综合久久综合中文综合网| 色综合 综合色| 91色九色蝌蚪| 欧美性一区二区| 欧美三级乱人伦电影| 欧美日韩国产综合草草| 欧美日韩aaa| 日韩一级成人av| 精品国产一区二区在线观看| 久久免费午夜影院| 国产片一区二区三区| 中文字幕第一区第二区| 亚洲欧美一区二区久久| 亚洲综合另类小说| 一本色道久久综合精品竹菊| 色妞www精品视频| 欧美日本在线观看| 欧美一区二区三级| 2017欧美狠狠色| 亚洲欧洲国产日本综合| 一区二区成人在线| 欧美aaa在线| 国产精品系列在线观看| 色综合久久久网| 337p亚洲精品色噜噜| 久久综合九色欧美综合狠狠| 国产精品乱人伦一区二区| 亚洲一区欧美一区| 美女一区二区三区| 成人福利电影精品一区二区在线观看| 91片黄在线观看| 制服丝袜亚洲精品中文字幕| 久久众筹精品私拍模特| 亚洲天堂免费在线观看视频| 亚洲成人av一区| 久久9热精品视频| av一二三不卡影片| 欧美一级电影网站| 国产精品每日更新| 丝袜诱惑亚洲看片| 国产在线不卡一区| 色综合久久久久综合体| 日韩美女视频一区二区在线观看| 国产精品国产自产拍高清av王其| 亚洲国产综合91精品麻豆| 韩国精品一区二区| 欧美吞精做爰啪啪高潮| 久久久精品综合| 偷拍日韩校园综合在线| 精品国产99国产精品| 亚洲狼人国产精品| 精品一区二区免费在线观看| av电影在线不卡| 精品国产伦一区二区三区观看方式 | 亚洲国产另类av| 国产精品一区二区三区网站| 欧美三电影在线| 亚洲国产精品高清| 久久精品av麻豆的观看方式| 色偷偷久久一区二区三区| 久久网站最新地址| 亚洲成人在线观看视频| 成人av免费观看| 精品欧美一区二区在线观看| 亚洲影视在线观看| 成人高清免费在线播放| 精品久久一区二区三区| 亚洲在线成人精品| 成人免费视频网站在线观看| 日韩欧美aaaaaa| 天天色天天爱天天射综合| 91天堂素人约啪| 国产欧美日本一区视频| 精品夜夜嗨av一区二区三区| 91麻豆精品国产91久久久资源速度| 亚洲欧美中日韩| 国产成人av电影免费在线观看| 日韩一区二区三区免费观看| 亚洲大片一区二区三区| 色婷婷综合中文久久一本| 国产精品久久久久久亚洲毛片 | 亚洲成av人综合在线观看| 99精品欧美一区| 国产日韩欧美a| 国产麻豆精品在线观看| 精品va天堂亚洲国产| 美腿丝袜在线亚洲一区| 91精品久久久久久蜜臀| 天天色图综合网| 欧美日韩不卡视频| 婷婷丁香久久五月婷婷| 欧美日韩国产大片| 亚洲成人黄色小说| 欧美日韩国产综合视频在线观看 | 91老师片黄在线观看| 国产精品女主播av| 国产成人精品三级| 国产欧美综合在线| 国产精品资源在线观看| 久久先锋影音av| 国产精品一区二区在线看| 久久色成人在线| 国产黄色精品网站| 国产精品美女久久久久久| 国产成人亚洲综合a∨猫咪| 久久久久成人黄色影片| 丰满亚洲少妇av| 国产精品久久久久久久久免费丝袜 | 国产一区二区久久| 久久久久国产精品免费免费搜索| 国产精品69久久久久水密桃| 国产欧美一区二区三区在线老狼| 成人一级片网址| 亚洲欧美日韩国产手机在线| 欧美亚洲国产怡红院影院| 亚洲不卡在线观看| 欧美大片在线观看一区二区| 国产一区三区三区| 国产精品网站在线播放| 91蝌蚪国产九色| 亚洲成人自拍一区| 精品嫩草影院久久| 成人性生交大片免费看中文| 亚洲另类中文字| 欧美肥大bbwbbw高潮| 狠狠v欧美v日韩v亚洲ⅴ| 国产欧美日韩视频在线观看| 91免费在线播放| 五月天国产精品| 久久久精品免费观看| 91麻豆免费看片| 日韩av网站免费在线| 国产亚洲欧美日韩在线一区| 91猫先生在线| 美女任你摸久久| 国产精品无遮挡| 欧美亚洲国产怡红院影院| 精品一区二区三区在线播放视频| 亚洲国产精品av| 欧美精品vⅰdeose4hd| 国产乱码精品一区二区三区av| 亚洲欧美日本在线| 日韩视频免费观看高清完整版| 国产成人综合亚洲91猫咪| 一区二区三区蜜桃| 久久久久久夜精品精品免费| 91电影在线观看| 精彩视频一区二区三区| 亚洲激情图片qvod| 精品国产麻豆免费人成网站| 色综合久久88色综合天天6| 免费视频一区二区| 亚洲欧美色图小说| 久久久久国产一区二区三区四区| 欧美在线观看一区二区| 国产美女av一区二区三区| 亚洲一区国产视频| 国产日韩av一区二区| 91精品国产综合久久久久久久久久 | 亚洲丝袜美腿综合| 日韩精品一区二区三区在线| 日本大香伊一区二区三区| 国产永久精品大片wwwapp| 亚洲高清在线精品| 中文字幕免费观看一区| 欧美一区二区视频观看视频| 色综合久久88色综合天天| 国产一区二区在线视频| 天堂蜜桃91精品| 亚洲免费观看在线视频| 久久久蜜桃精品| 日韩欧美视频一区| 欧美日精品一区视频| 91色视频在线| 成人一区在线观看| 韩国精品久久久| 日本不卡中文字幕| 亚洲一区在线视频观看| 日韩毛片高清在线播放| 久久久亚洲精华液精华液精华液| 欧美一级久久久| 欧美巨大另类极品videosbest| 99re热视频精品| 东方欧美亚洲色图在线| 精品一区二区三区av| 免费精品视频最新在线| 首页国产欧美日韩丝袜| 亚洲综合视频在线观看| 中文字幕综合网| 亚洲视频综合在线| 国产精品理论片在线观看| 久久久91精品国产一区二区精品| 日韩欧美一区在线| 日韩欧美一区二区视频| 欧美一区二区国产| 欧美一区二区免费|