亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91精品国产综合久久精品app| 精品久久一区二区三区| 久久精品国产精品青草| 国产精品久久久久久久午夜片| 欧美日韩久久一区二区| av激情综合网| 久久99精品国产91久久来源| 亚洲一区免费视频| 日本一区二区免费在线| 精品欧美黑人一区二区三区| 欧美日韩免费一区二区三区| 波多野结衣在线aⅴ中文字幕不卡| 蜜臀av性久久久久av蜜臀妖精 | 中文字幕一区二区三| 欧美成人bangbros| 欧美日韩成人高清| 色哟哟在线观看一区二区三区| 国产精品主播直播| 黄一区二区三区| 日本视频一区二区| 首页欧美精品中文字幕| 亚洲自拍偷拍麻豆| 一区二区三区资源| 中文字幕中文字幕一区| 国产亚洲一本大道中文在线| 精品国免费一区二区三区| 欧美日韩精品福利| 欧美日韩一区二区三区四区五区| 99精品一区二区三区| 成人国产在线观看| 成人精品视频一区二区三区| 福利电影一区二区| 国产激情视频一区二区三区欧美| 精品一区二区三区免费毛片爱| 日韩成人一区二区三区在线观看| 亚洲成人动漫一区| 五月婷婷激情综合网| 亚洲电影视频在线| 亚洲成人午夜影院| 天天综合日日夜夜精品| 日韩中文字幕麻豆| 日本中文字幕一区| 免费在线看一区| 久久69国产一区二区蜜臀| 黄页视频在线91| 成人午夜av影视| www.久久精品| 欧美亚日韩国产aⅴ精品中极品| 日本精品裸体写真集在线观看| 91福利视频在线| 欧美日韩视频在线一区二区 | 国产视频在线观看一区二区三区| 国产亚洲一区二区三区在线观看| 国产精品亲子伦对白| 亚洲欧洲日韩一区二区三区| 一区二区三区在线播| 性久久久久久久久久久久| 久久精品免费看| 懂色av中文一区二区三区| 91免费视频观看| 精品视频一区二区三区免费| 日韩一区二区电影网| 久久久夜色精品亚洲| 1024亚洲合集| 日韩电影在线观看一区| 国产宾馆实践打屁股91| 色噜噜夜夜夜综合网| 日韩无一区二区| 亚洲国产高清不卡| 亚洲一区影音先锋| 国产一区免费电影| 91免费在线视频观看| 91精品国产综合久久精品图片| 久久综合狠狠综合久久综合88 | 欧美日韩一卡二卡三卡| 3d成人h动漫网站入口| 国产婷婷色一区二区三区四区 | 亚洲一区二区欧美| 美腿丝袜亚洲综合| 97超碰欧美中文字幕| 555夜色666亚洲国产免| 国产精品网站在线播放| 日韩精品久久理论片| 成人精品视频.| 日韩一级片网站| 国产精品久久久久久久浪潮网站| 日本vs亚洲vs韩国一区三区二区 | 亚洲精品伦理在线| 蜜臀a∨国产成人精品| 91欧美激情一区二区三区成人| 欧美一区二区三区公司| 综合av第一页| 国产精品综合久久| 欧美三级韩国三级日本一级| 国产欧美视频一区二区| 日本不卡免费在线视频| 一本大道久久a久久综合| 久久综合九色综合欧美98 | 亚洲黄一区二区三区| 精品在线一区二区三区| 在线免费亚洲电影| 国产欧美一区二区精品仙草咪| 日韩电影免费在线| 在线观看国产91| 综合分类小说区另类春色亚洲小说欧美 | 欧美午夜不卡在线观看免费| 国产三级三级三级精品8ⅰ区| 日本欧美一区二区| 欧美色综合网站| 成人欧美一区二区三区1314| 国产精品资源网站| 日韩精品一区二区三区在线观看 | 国产成人免费视频网站| 日韩免费观看高清完整版 | 欧美日韩一本到| 亚洲人xxxx| 成年人国产精品| 国产嫩草影院久久久久| 国产一区欧美二区| 精品国产精品网麻豆系列| 日韩国产欧美三级| 欧美精品久久一区二区三区| 亚洲一区二区三区国产| 欧美中文字幕亚洲一区二区va在线| 国产精品视频一二三| 粉嫩av一区二区三区在线播放| 久久影院电视剧免费观看| 麻豆传媒一区二区三区| 欧美一级在线视频| 蜜桃av一区二区三区电影| 日韩一区二区三区视频在线观看| 日本一区中文字幕| 日韩欧美国产一区二区在线播放| 蜜臀久久99精品久久久画质超高清| 欧美日韩在线免费视频| 午夜视频一区在线观看| 欧美日韩一区高清| 丝袜美腿亚洲综合| 日韩欧美成人一区二区| 久久国产精品无码网站| 精品国产3级a| 国产成人在线色| 亚洲国产精品高清| 91视频国产观看| 亚洲成人动漫一区| 日韩午夜激情免费电影| 国内成人自拍视频| 欧美国产一区视频在线观看| 成人午夜大片免费观看| 亚洲精品五月天| 欧美日韩在线不卡| 激情偷乱视频一区二区三区| 国产女主播视频一区二区| 91麻豆蜜桃一区二区三区| 亚洲妇熟xx妇色黄| 欧美一级爆毛片| 成人晚上爱看视频| 亚洲一区二区影院| 日韩一区二区视频在线观看| 国产美女视频91| 日韩毛片精品高清免费| 欧美三级三级三级| 国产伦精品一区二区三区在线观看| 日本一区二区免费在线| 欧美性色黄大片| 国产在线不卡一区| 亚洲色图色小说| 日韩欧美一区中文| 97se亚洲国产综合自在线| 日韩精品电影一区亚洲| 精品国产伦一区二区三区观看方式 | 精品一区二区三区在线观看国产| 国产精品色一区二区三区| 欧美日韩激情一区二区| 国产一区二区三区四区五区美女 | 日韩午夜小视频| 99久久er热在这里只有精品15| 午夜伦理一区二区| 久久免费精品国产久精品久久久久 | 成人aa视频在线观看| 日本不卡一区二区三区| 国产精品动漫网站| 日韩欧美国产一区二区三区| gogogo免费视频观看亚洲一| 免费精品99久久国产综合精品| 国产欧美va欧美不卡在线| 欧美日韩一区二区三区不卡 | 欧美中文字幕不卡| 国产成人综合自拍| 日韩电影在线观看网站| 成人免费在线视频观看| 久久亚洲二区三区| 欧美日韩国产一级片| www.亚洲在线| 久久国产精品免费| 亚洲第一激情av| 国产精品美女一区二区三区| 精品国产乱码久久久久久免费| 欧美日韩日日骚| 色综合色综合色综合色综合色综合|