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

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

?? testundochanges.java

?? cms是開(kāi)源的框架
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
 * File   : $Source: /usr/local/cvs/opencms/test/org/opencms/file/TestUndoChanges.java,v $
 * Date   : $Date: 2006/03/27 14:52:46 $
 * Version: $Revision: 1.20 $
 *
 * 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.CmsResourceTypePlain;
import org.opencms.lock.CmsLock;
import org.opencms.test.OpenCmsTestCase;
import org.opencms.test.OpenCmsTestProperties;
import org.opencms.test.OpenCmsTestResourceFilter;
import org.opencms.test.OpenCmsTestResourceStorage;

import java.util.Iterator;
import java.util.List;

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

/**
 * Unit test for the "undoChanges" method of the CmsObject.<p>
 * 
 * @author Michael Emmerich 
 * @version $Revision: 1.20 $
 */
public class TestUndoChanges extends OpenCmsTestCase {

    /**
     * Default JUnit constructor.<p>
     * 
     * @param arg0 JUnit parameters
     */
    public TestUndoChanges(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(TestUndoChanges.class.getName());

        suite.addTest(new TestUndoChanges("testUndoChangesResource"));
        suite.addTest(new TestUndoChanges("testUndoChangesOnNewResource"));
        suite.addTest(new TestUndoChanges("testUndoChangesFolder"));
        suite.addTest(new TestUndoChanges("testUndoChangesFolderRecursive"));
        suite.addTest(new TestUndoChanges("testUndoChangesAfterCopyNewOverDeleted"));
        suite.addTest(new TestUndoChanges("testUndoChangesAfterCopySiblingOverDeleted"));
        suite.addTest(new TestUndoChanges("testUndoChangesWithAce"));
        suite.addTest(new TestUndoChanges("testUndoChangesSharedProperty"));

        TestSetup wrapper = new TestSetup(suite) {

            protected void setUp() {

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

            protected void tearDown() {

                removeOpenCms();
            }
        };

        return wrapper;
    }

    /**
     * Tests undo changes on a new resource, this must lead to an exception!<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testUndoChangesOnNewResource() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing for exception when trying undo changes on a new resource");

        String source = "/types/new.html";

        // create a new, plain resource
        cms.createResource(source, CmsResourceTypePlain.getStaticTypeId());
        assertLock(cms, source, CmsLock.TYPE_EXCLUSIVE);

        try {
            cms.undoChanges(source, false);
        } catch (CmsVfsException e) {
            if (e.getMessageContainer().getKey().equals(org.opencms.db.Messages.ERR_UNDO_CHANGES_FOR_RESOURCE_1)) {
                // this is the expected result, so the test is successful
                return;
            }
        }
        fail("Did not catch expected exception trying undo changes on a new resource!");
    }

    /**
     * Tests undo changes after a resource was deleted and another 
     * resource was copied over the deleted file "as new".<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testUndoChangesAfterCopyNewOverDeleted() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing undo changes after overwriting a deleted file with a new file");

        String source = "/folder1/page2.html";
        String destination = "/folder1/page1.html";

        storeResources(cms, source);
        storeResources(cms, destination);

        cms.lockResource(destination);

        // delete and owerwrite
        cms.deleteResource(destination, CmsResource.DELETE_PRESERVE_SIBLINGS);
        assertState(cms, destination, CmsResource.STATE_DELETED);

        cms.copyResource(source, destination, CmsResource.COPY_AS_NEW);

        // now undo all changes on the resource
        cms.undoChanges(destination, false);

        // now ensure source and destionation are in the original state
        assertFilter(cms, source, OpenCmsTestResourceFilter.FILTER_EQUAL);
        assertFilter(cms, destination, OpenCmsTestResourceFilter.FILTER_UNDOCHANGES);

        // publishing may reveal problems with the id's
        cms.publishProject();
    }

    /**
     * Tests undo changes after a resource was deleted and another 
     * resource was copied over the deleted file "as sibling".<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testUndoChangesAfterCopySiblingOverDeleted() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing undo changes after overwriting a deleted file with a sibling");

        String source = "/folder1/page2.html";
        String destination = "/folder1/page1.html";

        storeResources(cms, source);
        storeResources(cms, destination);

        cms.lockResource(destination);

        // delete and owerwrite with a sibling
        cms.deleteResource(destination, CmsResource.DELETE_PRESERVE_SIBLINGS);
        assertState(cms, destination, CmsResource.STATE_DELETED);

        cms.copyResource(source, destination, CmsResource.COPY_AS_SIBLING);

        // now undo all changes on the resource
        cms.undoChanges(destination, false);

        // now ensure source and destionation are in the original state
        assertFilter(cms, source, OpenCmsTestResourceFilter.FILTER_UNDOCHANGES);
        assertFilter(cms, destination, OpenCmsTestResourceFilter.FILTER_UNDOCHANGES);

        // publishing may reveal problems with the id's
        cms.publishProject();
    }

    /**
     * Test the touch method to touch a single resource.<p>
     * @param tc the OpenCmsTestCase
     * @param cms the CmsObject
     * @param resource1 the resource to touch
     * @throws Throwable if something goes wrong
     */
    public static void undoChanges(OpenCmsTestCase tc, CmsObject cms, String resource1) throws Throwable {

        // create a global storage and store the resource
        tc.createStorage("undoChanges");
        tc.switchStorage("undoChanges");
        tc.storeResources(cms, resource1);
        tc.switchStorage(OpenCmsTestResourceStorage.DEFAULT_STORAGE);

        // now do a touch on the resource
        TestTouch.touchResource(tc, cms, resource1);

        // change a property
        CmsProperty property1 = new CmsProperty("Title", "undoChanges", null);
        TestProperty.writeProperty(tc, cms, resource1, property1);

        // now undo everything
        cms.lockResource(resource1);
        cms.undoChanges(resource1, false);
        cms.unlockResource(resource1);

        tc.switchStorage("undoChanges");

        // now evaluate the result
        tc.assertFilter(cms, resource1, OpenCmsTestResourceFilter.FILTER_UNDOCHANGES);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情校园春色| 色悠久久久久综合欧美99| 一区精品在线播放| 欧美情侣在线播放| 成人黄色综合网站| 免费一级欧美片在线观看| 国产精品对白交换视频| 精品理论电影在线观看 | 视频一区二区国产| 欧美国产欧美亚州国产日韩mv天天看完整| 欧美午夜精品一区二区三区| 成人综合激情网| 蜜臀av在线播放一区二区三区| 1区2区3区欧美| 欧美国产综合一区二区| 欧美成人在线直播| 欧美午夜免费电影| 91看片淫黄大片一级在线观看| 国产成人高清在线| 蜜乳av一区二区三区| 亚洲国产美国国产综合一区二区| 国产精品不卡在线观看| 精品国产乱码久久久久久免费 | 精品中文字幕一区二区| 日日摸夜夜添夜夜添精品视频 | 欧美日韩国产一区| 色999日韩国产欧美一区二区| 高清国产一区二区| 国产剧情在线观看一区二区| 另类小说欧美激情| 青娱乐精品在线视频| 亚洲国产美国国产综合一区二区| 亚洲精品ww久久久久久p站| 国产精品污www在线观看| 久久久九九九九| 久久午夜国产精品| 久久众筹精品私拍模特| 26uuu国产一区二区三区| 日韩免费一区二区三区在线播放| 欧美男男青年gay1069videost| 欧美优质美女网站| 欧美主播一区二区三区| 欧美在线免费播放| 欧美色手机在线观看| 欧美日韩国产三级| 欧美裸体一区二区三区| 欧美精品 日韩| 日韩一区二区三区高清免费看看| 日韩写真欧美这视频| 日韩精品中文字幕一区二区三区| 欧美一区二区美女| 久久婷婷综合激情| 久久久久9999亚洲精品| 国产精品视频在线看| 亚洲欧洲av在线| 亚洲另类中文字| 午夜久久久影院| 日本少妇一区二区| 国产一区二区三区在线看麻豆| 国产麻豆一精品一av一免费 | 免费看欧美女人艹b| 奇米精品一区二区三区在线观看一| 麻豆精品一区二区av白丝在线| 久久精品二区亚洲w码| 国产一区在线精品| 97精品国产露脸对白| 91福利精品第一导航| 欧美日韩成人一区二区| 欧美成人精品二区三区99精品| 国产亚洲精品免费| 亚洲视频在线一区| 天天综合天天综合色| 国内精品久久久久影院薰衣草 | 国产亚洲一本大道中文在线| 中文字幕在线免费不卡| 亚洲最快最全在线视频| 美女高潮久久久| thepron国产精品| 欧美精品一二三| 国产无一区二区| 天涯成人国产亚洲精品一区av| 国产高清视频一区| 欧美午夜精品一区| 久久精品夜色噜噜亚洲a∨| 玉足女爽爽91| 国产美女久久久久| 日本韩国欧美在线| 久久男人中文字幕资源站| 亚洲精选视频免费看| 激情久久五月天| 欧美性生交片4| 欧美国产国产综合| 青青草国产成人av片免费| 99久久精品一区二区| 欧美一区二区免费视频| 亚洲精品免费在线观看| 国产一区二区三区精品视频| 欧美三级日韩在线| 中文字幕一区二区日韩精品绯色| 麻豆高清免费国产一区| 欧美性色黄大片| 最新高清无码专区| 国产精选一区二区三区| 538prom精品视频线放| 中文字幕一区在线观看视频| 久久丁香综合五月国产三级网站 | 色老汉一区二区三区| 2023国产精品自拍| 亚洲成人免费视频| 成人18精品视频| 26uuu精品一区二区| 欧美aaa在线| 欧美日本在线播放| 亚洲精品免费看| 成人看片黄a免费看在线| 欧美成人官网二区| 美女视频黄免费的久久 | 欧美aaa在线| 欧美日韩视频在线第一区 | 成人精品高清在线| www国产亚洲精品久久麻豆| 男人的j进女人的j一区| 欧美日韩性生活| 亚洲国产精品一区二区久久 | 欧美日韩亚洲国产综合| 亚洲欧美韩国综合色| 99re这里只有精品视频首页| 久久久久国产精品麻豆| 国产不卡在线播放| 2017欧美狠狠色| 国产乱妇无码大片在线观看| 欧美一区二区免费| 久久99国内精品| 欧美变态tickle挠乳网站| 麻豆一区二区99久久久久| 91麻豆精品国产91久久久久久| 午夜欧美一区二区三区在线播放| 91激情在线视频| 天堂av在线一区| 91精品国产综合久久香蕉麻豆| 日韩精品一二区| 日韩一区二区三区视频在线观看| 麻豆国产一区二区| xnxx国产精品| 国产成人精品午夜视频免费 | 亚洲一区二区三区四区五区中文| 91久久精品日日躁夜夜躁欧美| 亚洲午夜一区二区| 欧美电影一区二区三区| 免费观看在线色综合| 日韩欧美亚洲一区二区| 国内成人免费视频| 国产喂奶挤奶一区二区三区| 国产成人鲁色资源国产91色综| 国产精品二三区| 欧美三级资源在线| 麻豆精品在线看| 中文字幕va一区二区三区| 99r精品视频| 视频在线观看一区| 精品国产乱码久久久久久牛牛 | 国产亚洲精品中文字幕| a级精品国产片在线观看| 一区二区三区蜜桃网| 欧美一级高清片在线观看| 国产河南妇女毛片精品久久久| 亚洲人成在线播放网站岛国| 欧美三级韩国三级日本三斤| 免费成人在线视频观看| 国产精品视频第一区| 欧美影院一区二区| 国产一区二区三区四| 亚洲精品视频自拍| 欧美成人综合网站| 91色九色蝌蚪| 久久精品国产一区二区三| 综合电影一区二区三区| 欧美日韩成人综合| 成人精品小蝌蚪| 婷婷开心激情综合| 中文字幕亚洲区| 欧美一区二区视频观看视频 | 欧美亚洲动漫精品| 国产在线精品国自产拍免费| 亚洲美女视频一区| 欧美成人三级在线| 91电影在线观看| 国产91精品一区二区麻豆网站 | 国产成人自拍网| 亚洲123区在线观看| 欧美国产综合色视频| 7777精品伊人久久久大香线蕉| 粉嫩高潮美女一区二区三区| 日一区二区三区| 国产精品久久久久9999吃药| 欧美xxxxx牲另类人与| 在线亚洲免费视频| 成人免费视频播放| 美女视频免费一区| 午夜精品久久久久久久|