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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? testpropertydefinition.java

?? cms是開源的框架
?? JAVA
字號:
/*
 * File   : $Source: /usr/local/cvs/opencms/test/org/opencms/file/TestPropertyDefinition.java,v $
 * Date   : $Date: 2005/06/23 11:11:43 $
 * Version: $Revision: 1.5 $
 *
 * This library is part of OpenCms -
 * the Open Source Content Mananagement System
 *
 * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * For further information about Alkacon Software GmbH, please see the
 * company website: http://www.alkacon.com
 *
 * For further information about OpenCms, please see the
 * project website: http://www.opencms.org
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package org.opencms.file;

import org.opencms.main.CmsException;
import org.opencms.test.OpenCmsTestCase;
import org.opencms.test.OpenCmsTestProperties;
import org.opencms.util.CmsUUID;

import java.util.List;

import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;

/**
 * Unit test for the "createPropertyDefinition", "readPropertyDefiniton" and
 * "readAllPropertyDefintions" methods of the CmsObject.<p>
 * 
 * @author Michael Emmerich 
 * @version $Revision: 1.5 $
 */
public class TestPropertyDefinition extends OpenCmsTestCase {

    /**
     * Default JUnit constructor.<p>
     * 
     * @param arg0 JUnit parameters
     */
    public TestPropertyDefinition(String arg0) {

        super(arg0);
    }

    /**
     * Test suite for this test class.<p>
     * 
     * @return the test suite
     */
    public static Test suite() {
        OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH);

        TestSuite suite = new TestSuite();
        suite.setName(TestPropertyDefinition.class.getName());

        suite.addTest(new TestPropertyDefinition("testCreatePropertyDefinition"));
        suite.addTest(new TestPropertyDefinition("testCreateReadDeletePropertyDefinition"));
        suite.addTest(new TestPropertyDefinition("testGetResourcesWithProperty"));
        
        TestSetup wrapper = new TestSetup(suite) {

            protected void setUp() {

                setupOpenCms("simpletest", "/sites/default/");
            }

            protected void tearDown() {

                removeOpenCms();
            }
        };

        return wrapper;
    }
    
    /**
     * Test the createPropertyDefintion method.<p>
     * @param tc the OpenCmsTestCase
     * @param cms the CmsObject
     * @param propertyDefiniton1 the property definition to create
     * @throws Throwable if something goes wrong
     */
    public static void createPropertyDefinition(OpenCmsTestCase tc, CmsObject cms, String propertyDefiniton1)
    throws Throwable {

        // get all propertydefintions
        List allPropertydefintions = cms.readAllPropertyDefinitions();
        // create a property defintion with a dummy id value (the real id is created by db)
        CmsPropertyDefinition prop = new CmsPropertyDefinition(
            CmsUUID.getNullUUID(),
            propertyDefiniton1);

        cms.createPropertyDefinition(propertyDefiniton1);

        // check if the propertsdefintion was written
        tc.assertPropertydefinitionExist(cms, prop);
        // check if all other properties are still identical
        tc.assertPropertydefinitions(cms, allPropertydefintions, prop);
    }

    /**
     * Test the createPropertyDefintion method.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testCreatePropertyDefinition() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing createPropetyDefinition and readPropertyDefiniton");
        createPropertyDefinition(this, cms, "NewPropertyDefinition");
    }

    /**
     * Test to create, read and delete a property definition through the cache driver.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testCreateReadDeletePropertyDefinition() throws Throwable {

        CmsObject cms = getCmsObject();

        echo("Testing creation of a new property definition");
        createReadDeletePropertyDefinition(cms);
    }

    /**
     * Test to create, read and delete a property definition through the cache driver.<p>
     * 
     * @param cms the CmsObject
     * @throws Throwable if something goes wrong
     */
    public static void createReadDeletePropertyDefinition(CmsObject cms) throws Throwable {

        CmsPropertyDefinition propertyDefinition = null;
        String propertyDefinitionName = "locale-available";
                
        // 1) create a property definition

        try {
            // create a new property definition
            propertyDefinition = cms.createPropertyDefinition(propertyDefinitionName);
        } catch (CmsException e) {
            fail("Error creating property definition " + propertyDefinitionName + ", " + e.toString());
        }

        assertEquals(propertyDefinition.getName(), propertyDefinitionName);

        // 2) read the created property definition
        
        try {
            // read the created property definition
            propertyDefinition = null;
            propertyDefinition = cms.readPropertyDefinition(propertyDefinitionName);
        } catch (CmsException e) {
            fail("Error reading property definition " + propertyDefinitionName + ", " + e.toString());
        }

        assertEquals(propertyDefinition.getName(), propertyDefinitionName);

        // 3) check if the new created property is contained in the list of all property definitions
        
        List allPropertyDefinitions = null;
        try {
            // read all property definitions
            allPropertyDefinitions = cms.readAllPropertyDefinitions();
        } catch (CmsException e) {
            fail("Error reading all property definitions, " + e.toString());
        }

        boolean found = false;
        for (int i = 0, n = allPropertyDefinitions.size(); i < n; i++) {
            if (((CmsPropertyDefinition)allPropertyDefinitions.get(i)).equals(propertyDefinition)) {
                found = true;
                break;
            }
        }
        
        if (!found) {
            fail("Property definition " + propertyDefinitionName + " is not in the list of all property definitions");
        }
        
        // 4) delete the new property definition again

        try {
            // delete the property definition again
            cms.deletePropertyDefinition(propertyDefinitionName);
        } catch (CmsException e) {
            fail("Error deleting property definition " + propertyDefinitionName + ", " + e.toString());
        }
        
        // 5) re-read the delete property definition to check that it is not found

        try {
            // re-read the created property definition
            propertyDefinition = null;
            propertyDefinition = cms.readPropertyDefinition(propertyDefinitionName);
        } catch (CmsException e) {
            // intentionally left blank
        }

        assertNull(propertyDefinition);
        
        // 6) re-read the list of all property definitions to check that it is not contained
        
        allPropertyDefinitions = null;
        try {
            // read all property definitions
            allPropertyDefinitions = cms.readAllPropertyDefinitions();
        } catch (CmsException e) {
            fail("Error reading all property definitions, " + e.toString());
        }

        found = false;
        for (int i = 0, n = allPropertyDefinitions.size(); i < n; i++) {
            if (((CmsPropertyDefinition)allPropertyDefinitions.get(i)).equals(propertyDefinition)) {
                found = true;
                break;
            }
        }  

        if (found) {
            fail("Property definition " + propertyDefinitionName + " is still in the list of all property definitions");
        }
        
    }

    /**
     * Tests reading all resources that have a specific property definition set.<p>
     * 
     * @throws Exception if something goes wrong
     */
    public void testGetResourcesWithProperty() throws Exception {
        
        echo("Testing reading all resources with a specific property");        
        CmsObject cms = getCmsObject();
        List result;
        
        result = cms.readResourcesWithProperty(CmsPropertyDefinition.PROPERTY_TITLE);
        assertEquals(63, result.size());
        result = cms.readResourcesWithProperty(CmsPropertyDefinition.PROPERTY_TEMPLATE);
        assertEquals(25, result.size());
    }
    
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91蝌蚪porny九色| 美国一区二区三区在线播放| 99久久精品免费看国产| 国产亚洲精品资源在线26u| 精品一区二区三区在线观看国产| 日韩午夜av电影| 蜜臀久久99精品久久久久宅男| 欧美一级高清片在线观看| 久久成人综合网| 久久精品人人做| 93久久精品日日躁夜夜躁欧美| 亚洲日本青草视频在线怡红院| 91福利视频久久久久| 日韩中文字幕亚洲一区二区va在线| 欧美日韩成人一区| 激情综合五月天| 国产精品天干天干在线综合| 色8久久人人97超碰香蕉987| 亚洲第一会所有码转帖| 精品少妇一区二区三区日产乱码| 国产精品一区一区三区| 亚洲国产精品二十页| 精品视频1区2区| 精品一区二区免费| 日韩一区中文字幕| 欧美精品少妇一区二区三区| 国产一区二区三区在线观看免费视频 | 一区二区三区在线视频播放| 欧美视频一区在线| 国产一区二区网址| 亚洲一二三四在线观看| 久久午夜电影网| 色www精品视频在线观看| 久久国产综合精品| 一区二区三区小说| 26uuu国产日韩综合| 色婷婷狠狠综合| 精品一区二区三区免费毛片爱| 中文字幕在线观看一区二区| 欧美一区二区视频免费观看| 成人av在线一区二区| 美女脱光内衣内裤视频久久网站| 最近日韩中文字幕| 欧美精品一区二区三区很污很色的 | 欧美韩国一区二区| 91精品国产综合久久福利 | 蜜桃av一区二区在线观看| 成人免费在线视频观看| 欧美大片一区二区| 欧美性猛交xxxx乱大交退制版| 国产成人免费视频网站| 人禽交欧美网站| 亚洲一级在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日韩欧美在线1卡| 在线精品视频免费观看| 成人91在线观看| 国产一区二区三区在线观看精品| 日产精品久久久久久久性色| 亚洲精品视频观看| 中文字幕在线观看一区二区| 久久久久久久网| 日韩美一区二区三区| 欧美日韩高清一区二区不卡| 日本高清不卡在线观看| 9l国产精品久久久久麻豆| 国产福利91精品一区| 国内不卡的二区三区中文字幕| 日本 国产 欧美色综合| 日韩和欧美一区二区三区| 亚洲一区二区三区小说| 一区二区视频免费在线观看| 国产精品人成在线观看免费| 国产欧美中文在线| 国产清纯白嫩初高生在线观看91| 久久久久久久久97黄色工厂| 日韩一卡二卡三卡四卡| 91精品国产综合久久福利| 欧美日产国产精品| 在线综合+亚洲+欧美中文字幕| 欧美视频一区在线观看| 欧美日韩在线播放三区四区| 欧美三级蜜桃2在线观看| 欧美视频中文字幕| 欧美日韩在线三区| 欧美精品自拍偷拍动漫精品| 6080日韩午夜伦伦午夜伦| 欧美精品第一页| 精品日韩99亚洲| 精品免费国产二区三区| 久久婷婷色综合| 国产精品久久久久久久蜜臀| 亚洲视频资源在线| 亚洲国产日韩一级| 日韩专区中文字幕一区二区| 久久丁香综合五月国产三级网站| 精品一区二区免费| 成人精品视频.| 91福利小视频| 777亚洲妇女| 久久精品人人做| 国产精品传媒视频| 午夜国产精品一区| 国产激情精品久久久第一区二区| 成人av网站免费观看| 在线观看国产一区二区| 日韩一区二区影院| 国产午夜精品一区二区三区视频| 亚洲欧洲日韩在线| 日韩国产精品大片| 成人性生交大片免费看视频在线 | 欧美日韩视频专区在线播放| 日韩欧美在线123| 国产精品不卡一区| 亚洲国产欧美在线| 国产大陆a不卡| 91黄色免费版| 久久久久久久久久久久电影| 亚洲激情综合网| 狠狠色狠狠色综合系列| 91国偷自产一区二区使用方法| 欧美一区二区成人6969| 成人欧美一区二区三区小说| 日韩成人伦理电影在线观看| 成人亚洲一区二区一| 欧美性色综合网| 久久久99精品久久| 调教+趴+乳夹+国产+精品| 成人性生交大片免费看中文网站| 欧美日韩一区二区三区在线 | 精品国产一区二区国模嫣然| 成人欧美一区二区三区黑人麻豆| 久久精品国产澳门| 色婷婷久久99综合精品jk白丝| 精品国产乱码久久久久久蜜臀| 一区二区三区毛片| 成人av电影免费在线播放| 91精品国产手机| 亚洲精品成a人| 成人综合婷婷国产精品久久 | 欧美性三三影院| 国产精品久久久久桃色tv| 久久精品国产亚洲5555| 欧美三区在线视频| 亚洲日本va在线观看| 国产成都精品91一区二区三 | 久久日一线二线三线suv| 亚洲国产欧美在线| 一本色道久久加勒比精品| 国产亚洲一区二区三区四区| 午夜精品福利一区二区三区av| 成人av第一页| 中文av一区特黄| av电影在线观看一区| 国产亚洲欧美日韩在线一区| 蜜臀av一区二区在线免费观看| 欧美日韩一区二区三区视频 | 亚洲一区二区中文在线| av在线不卡观看免费观看| 国产香蕉久久精品综合网| 久久99国产精品久久99果冻传媒| 欧美日韩专区在线| 亚洲一区二区精品视频| 欧美伊人久久久久久午夜久久久久| 中文字幕一区二区三区在线不卡| 国产成人综合网| 久久久久久久久久看片| 国产伦精品一区二区三区免费| 精品久久久影院| 国产又黄又大久久| 国产日韩欧美电影| 成人sese在线| 综合在线观看色| 在线精品视频免费观看| 亚洲高清久久久| 欧美精品xxxxbbbb| 免费欧美在线视频| 久久综合精品国产一区二区三区| 久久精品国产精品亚洲综合| 26uuu亚洲婷婷狠狠天堂| 激情亚洲综合在线| 国产精品丝袜在线| 色婷婷香蕉在线一区二区| 一级日本不卡的影视| 欧美日本精品一区二区三区| 蜜臀a∨国产成人精品| 日韩精品一区二区三区视频在线观看| 九九视频精品免费| 欧美国产精品一区二区| 99re免费视频精品全部| 亚洲成人7777| 26uuu精品一区二区在线观看| 国产91在线|亚洲| 亚洲欧美日韩国产综合| 欧美日韩国产一级| 国产在线视频不卡二| 亚洲区小说区图片区qvod| 欧美人体做爰大胆视频| 黄色日韩网站视频| 亚洲免费成人av|