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

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

?? testsiblings.java

?? cms是開源的框架
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * File   : $Source: /usr/local/cvs/opencms/test/org/opencms/file/TestSiblings.java,v $
 * Date   : $Date: 2006/04/27 15:32:45 $
 * Version: $Revision: 1.18 $
 *
 * 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.file.types.CmsResourceTypeBinary;
import org.opencms.file.types.CmsResourceTypeFolder;
import org.opencms.file.types.CmsResourceTypePlain;
import org.opencms.lock.CmsLock;
import org.opencms.main.OpenCms;
import org.opencms.report.CmsShellReport;
import org.opencms.test.OpenCmsTestCase;
import org.opencms.test.OpenCmsTestProperties;
import org.opencms.test.OpenCmsTestResourceFilter;
import org.opencms.util.CmsResourceTranslator;

import java.util.Collections;
import java.util.List;

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

/**
 * Unit test for operations on siblings.<p>
 * 
 * @author Thomas Weckert  
 * @version $Revision: 1.18 $
 */
public class TestSiblings extends OpenCmsTestCase {

    /**
     * Default JUnit constructor.<p>
     * 
     * @param arg0 JUnit parameters
     */
    public TestSiblings(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(TestSiblings.class.getName());        
        
        suite.addTest(new TestSiblings("testSiblingsCopy"));
        suite.addTest(new TestSiblings("testSiblingsCreate"));
        suite.addTest(new TestSiblings("testSiblingIssueAfterImport"));
        suite.addTest(new TestSiblings("testDeleteAllSiblings"));
        suite.addTest(new TestSiblings("testSiblingStateIssue"));        
        
        TestSetup wrapper = new TestSetup(suite) {
            
            protected void setUp() {
                setupOpenCms("simpletest", "/sites/default/");
            }
            
            protected void tearDown() {
                removeOpenCms();
            }
        };
        
        return wrapper;
    }    

    /**
     * Creates a copy of a resource as a new sibling.<p>
     * 
     * @param tc the OpenCms test case
     * @param cms the current user's Cms object
     * @param source path/resource name of the existing resource 
     * @param target path/resource name of the new sibling
     * @throws Throwable if something goes wrong
     */
    public static void copyResourceAsSibling(OpenCmsTestCase tc, CmsObject cms, String source, String target)
    throws Throwable {

        // save the source in the store
        tc.storeResources(cms, source);
        
        // copy source to target as a sibling, the new sibling should not be locked
        cms.copyResource(source, target, CmsResource.COPY_AS_SIBLING);

        // validate the source sibling
        
        // validate if all unmodified fields on the source resource are still equal
        tc.assertFilter(cms, source, OpenCmsTestResourceFilter.FILTER_EXISTING_SIBLING);
        // validate if the last-modified-in-project field is the current project
        tc.assertProject(cms, source, cms.getRequestContext().currentProject());
        // validate if the sibling count field has been incremented
        tc.assertSiblingCountIncremented(cms, source, 1);
        // validate if the sibling does not have a red flag
        tc.assertModifiedInCurrentProject(cms, source, false);
        // validate if the lock is an exclusive shared lock for the current user
        tc.assertLock(cms, source, CmsLock.TYPE_SHARED_EXCLUSIVE);

        // validate the target sibling
        
        // validate the fields that both in the existing and the new sibling have to be equal
        tc.assertFilter(cms, source, target, OpenCmsTestResourceFilter.FILTER_EXISTING_AND_NEW_SIBLING);
        // validate if the state of the new sibling is "new" (blue)
        tc.assertState(cms, target, CmsResource.STATE_NEW);
        // validate if the new sibling has a red flag
        tc.assertModifiedInCurrentProject(cms, target, true);
        // validate if the lock is an exclusive lock for the current user
        tc.assertLock(cms, target, CmsLock.TYPE_EXCLUSIVE);        
    }

    /**
     * Creates a new sibling of a resource.<p>
     * 
     * @param tc the OpenCms test case
     * @param cms the current user's Cms object
     * @param source path/resource name of the existing resource 
     * @param target path/resource name of the new sibling
     * @throws Throwable if something goes wrong
     */
    public static void createSibling(OpenCmsTestCase tc, CmsObject cms, String source, String target) throws Throwable {

        // save the source in the store
        tc.storeResources(cms, source);
        
        // create a new sibling from the source
        List properties = cms.readPropertyObjects(source, false);
        cms.createSibling(source, target, properties);

        // validate the source sibling
        
        // validate if all unmodified fields of the source are still equal
        tc.assertFilter(cms, source, OpenCmsTestResourceFilter.FILTER_EXISTING_SIBLING);        
        // validate if the last-modified-in-project field is the current project
        tc.assertProject(cms, source, cms.getRequestContext().currentProject());
        // validate if the sibling count field has been incremented
        tc.assertSiblingCountIncremented(cms, source, 1);
        // validate if the sibling does not have a red flag
        tc.assertModifiedInCurrentProject(cms, source, false);
        // validate if the lock is an exclusive shared lock for the current user
        tc.assertLock(cms, source, CmsLock.TYPE_SHARED_EXCLUSIVE);        

        // validate the target sibling
        
        // validate the fields that both in the existing and the new sibling have to be equal
        tc.assertFilter(cms, source, target, OpenCmsTestResourceFilter.FILTER_EXISTING_AND_NEW_SIBLING);
        // validate if the state of the new sibling is "new" (blue)
        tc.assertState(cms, target, CmsResource.STATE_NEW);
        // validate if the new sibling has a red flag
        tc.assertModifiedInCurrentProject(cms, target, true);
        // validate if the lock is an exclusive lock for the current user
        tc.assertLock(cms, target, CmsLock.TYPE_EXCLUSIVE);        
    }    
    
    /**
     * Tests the "copy as new sibling" function.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testSiblingsCopy() throws Throwable {

        CmsObject cms = getCmsObject(); 
        String source = "/index.html";
        String target = "/index_sibling.html";
        echo("Copying " + source + " as a new sibling to " + target);
        copyResourceAsSibling(this, cms, source, target);
    }
    
    /**
     * Tests the "copy as new sibling" function.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testSiblingsCreate() throws Throwable {

        CmsObject cms = getCmsObject();
        String source = "/folder1/image1.gif";
        String target = "/folder1/image1_sibling.gif";        
        echo("Creating a new sibling " + target + " from " + source);
        createSibling(this, cms, source, target);
    }
    
    /**
     * Error scenario where an import is deleted that contains siblings inside the same folders.<p>
     * 
     * @throws Exception if something goes wrong
     */
    public void testSiblingIssueAfterImport() throws Exception {       
        
        echo("Testing sibling issue after import");        
        
        CmsResourceTranslator oldFolderTranslator = OpenCms.getResourceManager().getFolderTranslator();
        
        CmsResourceTranslator folderTranslator = new CmsResourceTranslator(
            new String[] {
                "s#^/sites/default/content/bodys(.*)#/system/bodies$1#",
                "s#^/sites/default/pics/system(.*)#/system/workplace/resources$1#",

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美天天综合网| 亚洲欧美在线另类| 中文字幕+乱码+中文字幕一区| 亚洲视频在线一区| 国产综合一区二区| 制服丝袜亚洲色图| 亚洲精品中文在线影院| 国产美女一区二区| 91精品国产综合久久香蕉的特点 | 一区二区在线观看免费视频播放| 日韩av一二三| 91国产免费看| 亚洲欧洲日本在线| 成人永久aaa| 精品区一区二区| 视频一区在线播放| 在线免费观看日本欧美| 国产精品免费免费| 国产不卡视频在线播放| 久久久五月婷婷| 麻豆成人免费电影| 欧美一区二区三区四区五区 | 久久精品视频在线看| 日韩制服丝袜av| 欧美精品免费视频| 亚洲国产视频网站| 精品婷婷伊人一区三区三| 亚洲黄色性网站| 99久久99久久免费精品蜜臀| 国产欧美综合色| 国产99久久精品| 国产精品二三区| 99国产精品99久久久久久| 国产欧美日韩中文久久| 成人精品视频一区二区三区| 久久久蜜桃精品| 国产馆精品极品| 国产日韩v精品一区二区| 国产激情视频一区二区三区欧美 | 欧美精品一二三四| 肉肉av福利一精品导航| 日韩精品一区二区三区三区免费| 蜜臀av在线播放一区二区三区| 4438成人网| 久久丁香综合五月国产三级网站| 这里只有精品电影| 久久精品99久久久| 亚洲国产精品99久久久久久久久| 成人综合婷婷国产精品久久蜜臀| 国产调教视频一区| 91在线看国产| 亚洲国产成人av| 精品国产一区二区三区忘忧草 | 亚洲成人先锋电影| 欧美不卡激情三级在线观看| 极品少妇一区二区| 国产精品乱码妇女bbbb| 色综合中文字幕| 日日夜夜精品视频免费| 日韩一区二区电影| 国产精品一区二区免费不卡| ...av二区三区久久精品| 色呦呦国产精品| 日韩成人精品视频| 中文字幕免费一区| 制服丝袜亚洲色图| 99视频一区二区三区| 五月天亚洲婷婷| 久久精子c满五个校花| 在线观看视频一区二区欧美日韩| 首页综合国产亚洲丝袜| 欧美激情一区二区三区四区| 91国产福利在线| 国产一区在线观看视频| 亚洲国产一区二区在线播放| 亚洲精品在线网站| 色噜噜狠狠色综合中国| 麻豆一区二区在线| 亚洲在线视频一区| 国产精品久久久久久久蜜臀 | 99视频一区二区| 国模无码大尺度一区二区三区| 亚洲男人天堂av网| 国产欧美日韩另类一区| 51精品秘密在线观看| 91在线视频播放地址| 韩日欧美一区二区三区| 午夜久久久久久| 亚洲精品国产精华液| 欧美国产精品一区二区三区| 日韩欧美国产综合| 欧美日韩国产首页| 色嗨嗨av一区二区三区| 夫妻av一区二区| 国内精品久久久久影院薰衣草| 婷婷夜色潮精品综合在线| 亚洲欧美日韩国产成人精品影院 | 日韩欧美中文字幕精品| 欧美亚洲一区二区在线| 91在线播放网址| 成人免费观看男女羞羞视频| 久久se精品一区二区| 欧美aaaaaa午夜精品| 日韩专区在线视频| 亚洲6080在线| 午夜精品久久久久久久99樱桃| 亚洲视频一区二区在线| 国产精品久久久一本精品| 久久久精品免费网站| 久久婷婷色综合| 精品欧美一区二区三区精品久久| 91精品国产麻豆国产自产在线| 欧美性生交片4| 欧美日韩午夜影院| 欧美男人的天堂一二区| 欧美性色黄大片| 欧美精选午夜久久久乱码6080| 欧美日韩中文字幕精品| 欧美日韩一级二级| 正在播放一区二区| 精品区一区二区| 久久久亚洲综合| 国产欧美一区二区三区在线看蜜臀 | 久久综合五月天婷婷伊人| 日韩一级片在线观看| 69p69国产精品| 日韩欧美一级特黄在线播放| 精品国产乱码久久久久久夜甘婷婷 | 蜜桃视频在线一区| 国产在线观看一区二区| 国产91丝袜在线18| av亚洲精华国产精华| 在线视频一区二区三| 欧美日韩国产美女| 日韩一区二区免费在线电影| 久久日韩粉嫩一区二区三区| 国产偷国产偷亚洲高清人白洁| 中文字幕精品三区| 亚洲综合一区二区精品导航| 日韩精品成人一区二区在线| 国产一区三区三区| 99riav久久精品riav| 7777精品伊人久久久大香线蕉的| 久久先锋影音av鲁色资源| 综合av第一页| 欧美bbbbb| 91亚洲精华国产精华精华液| 7799精品视频| 欧美激情一区二区三区四区| 亚洲一二三区在线观看| 久久精品国产99国产精品| 99麻豆久久久国产精品免费 | 蜜桃av一区二区| 粗大黑人巨茎大战欧美成人| 欧美日韩亚洲综合一区| 国产视频视频一区| 亚洲午夜久久久久久久久电影院 | 久久久久久日产精品| 亚洲男人的天堂在线aⅴ视频| 麻豆精品精品国产自在97香蕉| 成人黄色片在线观看| 91.成人天堂一区| 国产精品福利影院| 国产尤物一区二区在线| 日本电影欧美片| 久久精品一级爱片| 日韩制服丝袜av| 91久久人澡人人添人人爽欧美| 精品日韩在线观看| 亚洲图片欧美色图| 91老司机福利 在线| 久久久久久电影| 久久精品国产免费| 欧美日韩在线不卡| 亚洲欧美日韩成人高清在线一区| 久久疯狂做爰流白浆xx| 欧美精选午夜久久久乱码6080| 亚洲欧美另类图片小说| 国产成人免费av在线| 欧美一级久久久| 图片区小说区区亚洲影院| 91麻豆高清视频| 国产精品久久国产精麻豆99网站| 国产乱人伦精品一区二区在线观看| 欧美日韩午夜在线| 亚洲高清在线视频| 91麻豆国产福利在线观看| |精品福利一区二区三区| 成人一区二区在线观看| 久久美女高清视频| 国产综合久久久久影院| 日韩一区和二区| 日产精品久久久久久久性色| 欧美日韩在线播放三区| 亚洲一区二区高清| 欧日韩精品视频| 亚洲一区自拍偷拍| 欧美日韩卡一卡二| 视频一区二区三区在线| 91精品在线免费|