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

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

?? basicdynabeantestcase.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * 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 java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import junit.framework.TestCase;
import junit.framework.Test;
import junit.framework.TestSuite;


/**
 * <p>Test Case for the <code>BasicDynaBean</code> implementation class.
 * These tests were based on the ones in <code>PropertyUtilsTestCase</code>
 * because the two classes provide similar levels of functionality.</p>
 *
 * @author Craig R. McClanahan
 * @version $Revision: 469743 $ $Date: 2006-11-01 01:27:40 +0000 (Wed, 01 Nov 2006) $
 */

public class BasicDynaBeanTestCase extends TestCase {


    // ---------------------------------------------------- Instance Variables


    /**
     * The basic test bean for each test.
     */
    protected DynaBean bean = null;


    /**
     * The set of property names we expect to have returned when calling
     * <code>getDynaProperties()</code>.  You should update this list
     * when new properties are added to TestBean.
     */
    protected final static String[] properties = {
        "booleanProperty",
        "booleanSecond",
        "doubleProperty",
        "floatProperty",
        "intArray",
        "intIndexed",
        "intProperty",
        "listIndexed",
        "longProperty",
        "mappedProperty",
        "mappedIntProperty",
        "nullProperty",
        "shortProperty",
        "stringArray",
        "stringIndexed",
        "stringProperty",
    };


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


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

        super(name);

    }


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


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

        // Instantiate a new DynaBean instance
        DynaClass dynaClass = createDynaClass();
        bean = dynaClass.newInstance();

        // Initialize the DynaBean's property values (like TestBean)
        bean.set("booleanProperty", new Boolean(true));
        bean.set("booleanSecond", new Boolean(true));
        bean.set("doubleProperty", new Double(321.0));
        bean.set("floatProperty", new Float((float) 123.0));
        int intArray[] = { 0, 10, 20, 30, 40 };
        bean.set("intArray", intArray);
        int intIndexed[] = { 0, 10, 20, 30, 40 };
        bean.set("intIndexed", intIndexed);
        bean.set("intProperty", new Integer(123));
        List listIndexed = new ArrayList();
        listIndexed.add("String 0");
        listIndexed.add("String 1");
        listIndexed.add("String 2");
        listIndexed.add("String 3");
        listIndexed.add("String 4");
        bean.set("listIndexed", listIndexed);
        bean.set("longProperty", new Long(321));
        HashMap mappedProperty = new HashMap();
        mappedProperty.put("First Key", "First Value");
        mappedProperty.put("Second Key", "Second Value");
        bean.set("mappedProperty", mappedProperty);
        HashMap mappedIntProperty = new HashMap();
        mappedIntProperty.put("One", new Integer(1));
        mappedIntProperty.put("Two", new Integer(2));
        bean.set("mappedIntProperty", mappedIntProperty);
        // Property "nullProperty" is not initialized, so it should return null
        bean.set("shortProperty", new Short((short) 987));
        String stringArray[] =
                { "String 0", "String 1", "String 2", "String 3", "String 4" };
        bean.set("stringArray", stringArray);
        String stringIndexed[] =
                { "String 0", "String 1", "String 2", "String 3", "String 4" };
        bean.set("stringIndexed", stringIndexed);
        bean.set("stringProperty", "This is a string");

    }


    /**
     * Return the tests included in this test suite.
     */
    public static Test suite() {

        return (new TestSuite(BasicDynaBeanTestCase.class));

    }


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

        bean = null;

    }



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


    /**
     * Corner cases on getDynaProperty invalid arguments.
     */
    public void testGetDescriptorArguments() {

        try {
            DynaProperty descriptor =
                    bean.getDynaClass().getDynaProperty("unknown");
            assertNull("Unknown property descriptor should be null",
                    descriptor);
        } catch (Throwable t) {
            fail("Threw " + t + " instead of returning null");
        }

        try {
            bean.getDynaClass().getDynaProperty(null);
            fail("Should throw IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // Expected response
        } catch (Throwable t) {
            fail("Threw " + t + " instead of IllegalArgumentException");
        }

    }


    /**
     * Positive getDynaProperty on property <code>booleanProperty</code>.
     */
    public void testGetDescriptorBoolean() {

        testGetDescriptorBase("booleanProperty", Boolean.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>doubleProperty</code>.
     */
    public void testGetDescriptorDouble() {

        testGetDescriptorBase("doubleProperty", Double.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>floatProperty</code>.
     */
    public void testGetDescriptorFloat() {

        testGetDescriptorBase("floatProperty", Float.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>intProperty</code>.
     */
    public void testGetDescriptorInt() {

        testGetDescriptorBase("intProperty", Integer.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>longProperty</code>.
     */
    public void testGetDescriptorLong() {

        testGetDescriptorBase("longProperty", Long.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>booleanSecond</code>
     * that uses an "is" method as the getter.
     */
    public void testGetDescriptorSecond() {

        testGetDescriptorBase("booleanSecond", Boolean.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>shortProperty</code>.
     */
    public void testGetDescriptorShort() {

        testGetDescriptorBase("shortProperty", Short.TYPE);

    }


    /**
     * Positive getDynaProperty on property <code>stringProperty</code>.
     */
    public void testGetDescriptorString() {

        testGetDescriptorBase("stringProperty", String.class);

    }


    /**
     * Positive test for getDynaPropertys().  Each property name
     * listed in <code>properties</code> should be returned exactly once.
     */
    public void testGetDescriptors() {

        DynaProperty pd[] = bean.getDynaClass().getDynaProperties();
        assertNotNull("Got descriptors", pd);
        int count[] = new int[properties.length];
        for (int i = 0; i < pd.length; i++) {
            String name = pd[i].getName();
            for (int j = 0; j < properties.length; j++) {
                if (name.equals(properties[j]))
                    count[j]++;
            }
        }
        for (int j = 0; j < properties.length; j++) {
            if (count[j] < 0)
                fail("Missing property " + properties[j]);
            else if (count[j] > 1)
                fail("Duplicate property " + properties[j]);
        }

    }


    /**
     * Corner cases on getIndexedProperty invalid arguments.
     */
    public void testGetIndexedArguments() {

        try {
            bean.get("intArray", -1);
            fail("Should throw IndexOutOfBoundsException");
        } catch (IndexOutOfBoundsException e) {
            // Expected response
        } catch (Throwable t) {
            fail("Threw " + t + " instead of IndexOutOfBoundsException");
        }


    }


    /**
     * Positive and negative tests on getIndexedProperty valid arguments.
     */
    public void testGetIndexedValues() {

        Object value = null;

        for (int i = 0; i < 5; i++) {

            try {
                value = bean.get("intArray", i);
                assertNotNull("intArray returned value " + i, value);
                assertTrue("intArray returned Integer " + i,
                        value instanceof Integer);
                assertEquals("intArray returned correct " + i, i * 10,
                        ((Integer) value).intValue());
            } catch (Throwable t) {
                fail("intArray " + i + " threw " + t);
            }

            try {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三日本三级三级在线播放| 中文字幕精品一区二区精品绿巨人 | 亚洲天堂2016| 日韩高清国产一区在线| 成人av电影观看| 日韩一级黄色大片| 亚洲一区在线电影| 99精品久久只有精品| 精品国产a毛片| 日日骚欧美日韩| 欧美三级欧美一级| 亚洲影院久久精品| 99久久精品久久久久久清纯| 久久综合成人精品亚洲另类欧美| 亚洲综合激情网| 色乱码一区二区三区88| 国产精品毛片高清在线完整版 | 色哟哟一区二区| 国产喂奶挤奶一区二区三区| 天天综合日日夜夜精品| 欧美熟乱第一页| 玉米视频成人免费看| 色综合久久中文字幕综合网| 国产精品天干天干在线综合| 国产精一区二区三区| 久久久夜色精品亚洲| 激情综合五月天| 精品欧美一区二区三区精品久久 | 一区二区三区日韩精品| 91影院在线免费观看| 亚洲美女免费视频| 9久草视频在线视频精品| 国产精品萝li| 91片黄在线观看| 亚洲影院免费观看| 8v天堂国产在线一区二区| 视频精品一区二区| 日韩欧美激情四射| 国产精品自拍毛片| 国产精品久久久久久久久免费相片| 成人精品高清在线| 亚洲视频在线一区观看| 欧美色视频一区| 舔着乳尖日韩一区| 欧美电视剧免费全集观看| 国产综合成人久久大片91| 国产三级精品在线| 91美女视频网站| 亚洲综合男人的天堂| 5月丁香婷婷综合| 国产一区在线视频| 亚洲三级电影全部在线观看高清| 欧美性猛交xxxxxx富婆| 久久精品免费看| 国产精品视频yy9299一区| 欧洲精品在线观看| 琪琪久久久久日韩精品| 欧美激情在线观看视频免费| 91搞黄在线观看| 蜜桃视频在线观看一区二区| 久久精品欧美日韩精品| 色诱亚洲精品久久久久久| 婷婷国产v国产偷v亚洲高清| 久久久久综合网| 欧美色欧美亚洲另类二区| 日本在线不卡视频| 中文字幕制服丝袜一区二区三区 | 亚洲自拍偷拍图区| 欧美一级高清片在线观看| 国产成人精品在线看| 三级成人在线视频| 中文字幕一区在线| 日韩欧美一区二区免费| 一本色道久久综合亚洲91| 老司机精品视频线观看86 | 色av成人天堂桃色av| 精品一区二区在线播放| 亚洲精品中文字幕在线观看| 日韩精品中文字幕在线不卡尤物| 91网站最新地址| 国产伦精品一区二区三区视频青涩| 亚洲综合久久久久| 中文在线一区二区| 久久亚洲春色中文字幕久久久| 欧美性生活大片视频| 不卡av在线免费观看| 久久精品噜噜噜成人88aⅴ| 亚洲成人资源在线| 亚洲精品一二三| 国产精品久久久久aaaa樱花| 精品国产乱码久久久久久影片| 欧美三级视频在线| 91在线观看地址| k8久久久一区二区三区 | 88在线观看91蜜桃国自产| 91尤物视频在线观看| 不卡av免费在线观看| 国产精品一区二区三区四区| 日韩av中文字幕一区二区三区| 亚洲精品成a人| 玉米视频成人免费看| 专区另类欧美日韩| **欧美大码日韩| 亚洲人吸女人奶水| 亚洲欧美电影院| 亚洲欧洲色图综合| 亚洲天堂av老司机| 樱花草国产18久久久久| 亚洲欧洲日产国码二区| 国产精品久久久久久久久久免费看| 国产欧美综合在线| 国产欧美一区二区三区在线看蜜臀| 久久亚洲一区二区三区明星换脸| 日韩精品综合一本久道在线视频| 欧美一级片免费看| 精品久久人人做人人爰| 久久色成人在线| 日本一区二区视频在线| 国产精品亲子伦对白| 成人欧美一区二区三区| 亚洲精品乱码久久久久| 亚洲bt欧美bt精品| 青青国产91久久久久久| 久久99国产精品麻豆| 国产成人午夜99999| 99视频一区二区| 欧美性大战久久久久久久| 欧美日韩精品高清| 精品国产91亚洲一区二区三区婷婷| 精品国精品国产| 亚洲私人黄色宅男| 亚洲成a人片综合在线| 秋霞午夜鲁丝一区二区老狼| 国产呦萝稀缺另类资源| av动漫一区二区| 欧美情侣在线播放| 精品国产精品一区二区夜夜嗨| 国产午夜精品在线观看| 亚洲免费观看高清完整版在线| 亚洲国产中文字幕在线视频综合| 欧美bbbbb| 不卡一区二区在线| 欧美美女黄视频| 国产亚洲欧美在线| 亚洲亚洲精品在线观看| 国产一区二区三区四区五区入口| av成人动漫在线观看| 欧美日本一区二区三区四区| 久久免费电影网| 亚洲综合av网| 国产成人精品亚洲日本在线桃色| 91蝌蚪国产九色| 精品电影一区二区| 一区二区三区在线视频免费| 狠狠色丁香婷综合久久| 91福利视频在线| 国产无一区二区| 水野朝阳av一区二区三区| 本田岬高潮一区二区三区| 欧美日韩成人综合在线一区二区| 中文欧美字幕免费| 蜜臀久久99精品久久久久久9| 91丨九色丨蝌蚪富婆spa| 精品久久久久久亚洲综合网| 曰韩精品一区二区| 成人免费毛片嘿嘿连载视频| 欧美一级国产精品| 亚洲精品免费在线观看| 国产suv精品一区二区6| 日韩午夜小视频| 亚洲国产欧美一区二区三区丁香婷| 国产一区二区美女| 日韩免费高清av| 丝袜a∨在线一区二区三区不卡| 波多野结衣91| 国产精品天美传媒| 国产成人精品亚洲日本在线桃色 | 欧美精品一卡两卡| 亚洲欧美偷拍卡通变态| 成人综合激情网| 久久久美女毛片| 激情综合网天天干| 日韩欧美一区二区免费| 五月激情综合婷婷| 欧美日韩一区小说| 亚洲国产精品欧美一二99| 91色婷婷久久久久合中文| 国产精品麻豆网站| 成人黄色综合网站| 国产精品全国免费观看高清| 国产一区二区三区综合| 久久久精品日韩欧美| 国产在线视频精品一区| 欧美精品一区男女天堂| 国产自产视频一区二区三区| 精品国产乱码久久久久久影片| 国内精品不卡在线| 国产日本亚洲高清| 成人一区二区三区中文字幕| 国产精品嫩草影院com|