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

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

?? opencmstestcase.java

?? cms是開源的框架
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/*
 * File   : $Source: /usr/local/cvs/opencms/test/org/opencms/test/OpenCmsTestCase.java,v $
 * Date   : $Date: 2006/07/19 13:19:12 $
 * Version: $Revision: 1.92 $
 *
 * 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.test;

import org.opencms.db.CmsDbPool;
import org.opencms.file.CmsFile;
import org.opencms.file.CmsGroup;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsProperty;
import org.opencms.file.CmsPropertyDefinition;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceFilter;
import org.opencms.file.CmsUser;
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.CmsException;
import org.opencms.main.CmsShell;
import org.opencms.main.CmsSystemInfo;
import org.opencms.main.OpenCms;
import org.opencms.report.CmsShellReport;
import org.opencms.security.CmsAccessControlEntry;
import org.opencms.security.CmsAccessControlList;
import org.opencms.security.CmsPermissionSet;
import org.opencms.setup.CmsSetupDb;
import org.opencms.util.CmsDateUtil;
import org.opencms.util.CmsFileUtil;
import org.opencms.util.CmsPropertyUtils;
import org.opencms.util.CmsUUID;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import junit.framework.TestCase;

import org.apache.commons.collections.ExtendedProperties;

import org.dom4j.Document;
import org.dom4j.Node;
import org.dom4j.util.NodeComparator;

/** 
 * Extends the JUnit standard with methods to handle an OpenCms database
 * test instance.<p>
 * 
 * The required configuration files are located in the 
 * <code>${test.data.path}/WEB-INF</code> folder structure.<p>
 * 
 * To run this test you might have to change the database connection
 * values in the provided <code>${test.data.path}/WEB-INF/config/opencms.properties</code> file.<p>
 * 
 * @author Alexander Kandzior 
 * 
 * @version $Revision: 1.92 $
 * 
 * @since 6.0.0
 */
public class OpenCmsTestCase extends TestCase {

    /** Class to bundle the connection information. */
    protected class ConnectionData {

        /** The name of the database. */
        public String m_dbName;

        /** The database driver. */
        public String m_jdbcDriver;

        /** The database url. */
        public String m_jdbcUrl;

        /** Additional database params. */
        public String m_jdbcUrlParams;

        /** The name of the user. */
        public String m_userName;

        /** The password of the user. */
        public String m_userPassword;
    }

    /**
     * Extension of <code>NodeComparator</code> to store unequal nodes.<p>
     */
    class InternalNodeComparator extends NodeComparator {

        /** Unequal node1. */
        public Node m_node1 = null;

        /** Unequal node2. */
        public Node m_node2 = null;

        /**
         * @see org.dom4j.util.NodeComparator#compare(org.dom4j.Node, org.dom4j.Node)
         */
        public int compare(Node n1, Node n2) {

            int result = super.compare(n1, n2);
            if (result != 0 && m_node1 == null) {
                m_node1 = n1;
                m_node2 = n2;
            }
            return result;
        }
    }

    /** Key for tests on MySql database. */
    public static final String DB_MYSQL = "mysql";

    /** Key for tests on Oracle database. */
    public static final String DB_ORACLE = "oracle";

    /** The OpenCms/database configuration. */
    public static ExtendedProperties m_configuration = null;

    /** DB product used for the tests. */
    public static String m_dbProduct = DB_MYSQL;

    /** Name of the default tablespace (oracle only). */
    public static String m_defaultTablespace;

    /** Name of the index tablespace (oracle only). */
    public static String m_indexTablespace;

    /** The internal storages. */
    public static HashMap m_resourceStorages;

    /** Name of the temporary tablespace (oracle only). */
    public static String m_tempTablespace;

    /** Additional connection data. */
    protected static ConnectionData m_additionalConnection;

    /** The user connection data. */
    protected static ConnectionData m_defaultConnection;

    /** The setup connection data. */
    protected static ConnectionData m_setupConnection;

    /** The additional connection name. */
    private static String m_additionalConnectionName = "additional";

    /** The file date of the configuration files. */
    private static long[] m_dateConfigFiles;

    /** The path to the default setup data files. */
    private static String m_setupDataPath;

    /** The initialized OpenCms shell instance. */
    private static CmsShell m_shell;

    /** The list of paths to the additional test data files. */
    private static List m_testDataPath;

    /** The current resource storage. */
    public OpenCmsTestResourceStorage m_currentResourceStrorage;

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

        this(arg0, true);
    }

    /**
     * JUnit constructor.<p>
     * @param arg0 JUnit parameters
     * @param initialize indicates if the configuration will be initialized
     */
    public OpenCmsTestCase(String arg0, boolean initialize) {

        super(arg0);
        if (initialize) {
            OpenCmsTestLogAppender.setBreakOnError(false);
            if (m_resourceStorages == null) {
                m_resourceStorages = new HashMap();
            }

            // initialize configuration
            initConfiguration();

            // set "OpenCmsLog" system property to enable the logger
            OpenCmsTestLogAppender.setBreakOnError(true);
        }
    }

    /**
     * Generates a sub tree of folders with files.<p>
     * 
     * @param cms the cms context
     * @param vfsFolder where to create the subtree
     * @param maxWidth an upper bound for the number of subfolder a folder should have
     * @param maxDepth an upper bound for depth of the genearted subtree
     * @param maxProps upper bound for number of properties to create for each resource
     * @param propertyDistribution a percentage: x% shared props and (1-x)% individuals props
     * @param maxNumberOfFiles upper bound for the number of files in each folder
     * @param fileTypeDistribution a percentage: x% binary files and (1-x)% text files
     * 
     * @return the number of really written files
     * 
     * @throws Exception if something goes wrong
     */
    public static int generateContent(
        CmsObject cms,
        String vfsFolder,
        int maxWidth,
        int maxDepth,
        int maxProps,
        double propertyDistribution,
        int maxNumberOfFiles,
        double fileTypeDistribution) throws Exception {

        int fileNameLength = 10;
        int propValueLength = 10;

        // end recursion
        if (maxDepth < 1) {
            return 0;
        }
        if (!vfsFolder.endsWith("/")) {
            vfsFolder += "/";
        }

        int writtenFiles = 0;

        int width = (int)(maxWidth * Math.random()) + 1;
        int depth = maxDepth - (int)(2 * Math.random());
        for (int i = 0; i < width; i++) {
            // generate folder
            String vfsName = vfsFolder + generateName(fileNameLength) + i;
            List props = generateProperties(cms, maxProps, propValueLength, propertyDistribution);
            cms.createResource(vfsName, CmsResourceTypeFolder.getStaticTypeId(), new byte[0], props);
            cms.unlockResource(vfsName);

            int numberOfFiles = (int)(maxNumberOfFiles * Math.random()) + 1;
            // generate binary files
            int numberOfBinaryFiles = (int)(numberOfFiles * fileTypeDistribution);
            writtenFiles += generateResources(
                cms,
                "org/opencms/search/pdf-test-112.pdf",
                vfsName,
                numberOfBinaryFiles,
                CmsResourceTypeBinary.getStaticTypeId(),
                maxProps,
                propertyDistribution);

            // generate text files
            writtenFiles += generateResources(cms, "org/opencms/search/extractors/test1.html", vfsName, numberOfFiles
                - numberOfBinaryFiles, CmsResourceTypePlain.getStaticTypeId(), maxProps, propertyDistribution);

            // in depth recursion
            writtenFiles += generateContent(
                cms,
                vfsName,
                maxWidth,
                depth - 1,
                maxProps,
                propertyDistribution,
                maxNumberOfFiles,
                fileTypeDistribution);

            System.out.println("" + writtenFiles + " files written in Folder " + vfsName);
        }
        return writtenFiles;
    }

    /**
     * Generates a sub tree of folders with files.<p>
     * 
     * @param cms the cms context
     * @param vfsFolder name of the folder
     * @param numberOfFiles the number of files to generate
     * @param fileTypeDistribution a percentage: x% binary files and (1-x)% text files
     * 
     * @return the number of files generated
     * 
     * @throws Exception if something goes wrong
     */
    public static int generateContent(CmsObject cms, String vfsFolder, int numberOfFiles, double fileTypeDistribution)
    throws Exception {

        int maxProps = 10;
        double propertyDistribution = 0.0;
        int writtenFiles = 0;

        int numberOfBinaryFiles = (int)(numberOfFiles * fileTypeDistribution);

        // generate binary files
        writtenFiles += generateResources(
            cms,
            "org/opencms/search/pdf-test-112.pdf",
            vfsFolder,
            numberOfBinaryFiles,
            CmsResourceTypeBinary.getStaticTypeId(),
            maxProps,
            propertyDistribution);

        // generate text files
        writtenFiles += generateResources(cms, "org/opencms/search/extractors/test1.html", vfsFolder, numberOfFiles
            - numberOfBinaryFiles, CmsResourceTypePlain.getStaticTypeId(), maxProps, propertyDistribution);

        System.out.println("" + writtenFiles + " files written in Folder " + vfsFolder);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品亚洲porn| 狠狠v欧美v日韩v亚洲ⅴ| 久久久久久9999| 欧美人体做爰大胆视频| 91蝌蚪porny成人天涯| 韩国精品在线观看| 蜜臀精品久久久久久蜜臀 | 亚洲第一会所有码转帖| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美日韩色一区| 国产精品一区在线观看乱码 | 欧美一级精品大片| 精品视频在线视频| 欧美日韩美少妇| 欧美猛男男办公室激情| 精品婷婷伊人一区三区三| 91黄色激情网站| 欧美伊人久久大香线蕉综合69| 91性感美女视频| 欧美午夜精品久久久久久超碰| 欧洲一区二区av| 91精品国产综合久久精品性色| 色婷婷激情久久| 99精品欧美一区二区蜜桃免费| av电影在线观看一区| 97se亚洲国产综合自在线观| 在线国产亚洲欧美| 91精品国产综合久久福利软件| 日韩一区二区三区在线观看| 精品免费一区二区三区| 中文字幕av免费专区久久| 亚洲欧洲制服丝袜| 麻豆精品在线看| 不卡视频一二三四| 91麻豆精品国产91久久久使用方法| 在线观看网站黄不卡| 7878成人国产在线观看| 5月丁香婷婷综合| 欧美精品一区二区三区视频| 日韩女优制服丝袜电影| 久久一日本道色综合| 日本一区二区久久| 亚洲一区二区三区精品在线| 看电影不卡的网站| av一区二区久久| 日韩一区二区三区在线| 久久精品欧美一区二区三区不卡| 综合精品久久久| 裸体在线国模精品偷拍| 精品亚洲porn| 欧美少妇性性性| 日本一区二区高清| 日韩国产精品久久久| 日本一区二区三区在线不卡| 3d成人动漫网站| 日本一区二区三区久久久久久久久不| 国产精品污网站| 五月天激情综合| 国产91丝袜在线观看| 欧美日韩激情一区二区三区| 蜜臀91精品一区二区三区| 久久精品国产精品亚洲综合| 成人小视频在线| 欧美久久久久免费| 国产精品久久国产精麻豆99网站| 视频一区欧美精品| av在线不卡免费看| 中文字幕精品综合| 久久99精品久久久久久动态图| 9人人澡人人爽人人精品| 91精品国产综合久久久蜜臀粉嫩| 亚洲精品一二三四区| 国产成人夜色高潮福利影视| 日韩欧美你懂的| 亚洲一区视频在线| 91老司机福利 在线| 国产欧美精品一区aⅴ影院| 国产乱码精品一区二区三区忘忧草 | 亚洲一二三专区| 国产老妇另类xxxxx| 日韩精品在线一区| 激情综合色综合久久| 精品裸体舞一区二区三区| 日本视频在线一区| 欧美精品一区男女天堂| 韩国三级中文字幕hd久久精品| 欧美日韩aaaaaa| 琪琪久久久久日韩精品| 欧美亚洲国产bt| 亚洲黄色免费电影| 欧洲精品一区二区| 加勒比av一区二区| 国产精品传媒在线| 欧美性生交片4| 日本sm残虐另类| 国产精品免费人成网站| 色老汉一区二区三区| 亚洲无人区一区| 欧美大片一区二区三区| 国产成人丝袜美腿| 亚洲综合小说图片| 欧美一级黄色片| 国产精品乡下勾搭老头1| 亚洲少妇中出一区| 欧美一区二区视频在线观看2022 | 成人污污视频在线观看| 一区二区三区在线观看网站| 日韩欧美视频在线| 成人av在线一区二区| 亚洲国产中文字幕在线视频综合| 久久亚洲一区二区三区四区| 97久久精品人人爽人人爽蜜臀| 一区二区三区在线免费| 国产精品久久午夜| 欧美大片日本大片免费观看| 欧美中文字幕不卡| 99久久综合99久久综合网站| 精品一区二区在线免费观看| 亚洲福利一二三区| 亚洲自拍偷拍网站| 国产欧美日韩久久| 精品国产免费一区二区三区香蕉| 91亚洲精品久久久蜜桃网站| 久久9热精品视频| 亚洲国产一二三| 亚洲精选免费视频| 亚洲天堂网中文字| 中文字幕亚洲一区二区av在线 | 宅男噜噜噜66一区二区66| 日本二三区不卡| 日韩欧美中文一区二区| 欧美又粗又大又爽| 在线一区二区三区| 国产精品资源在线| 国产一区二区三区日韩| 国产一区二区免费视频| 免费的国产精品| 日韩精品午夜视频| 久久国内精品视频| 精品一区二区三区在线观看国产| 激情综合亚洲精品| 国产成人精品免费一区二区| 国产成人夜色高潮福利影视| 国产一区在线精品| 色哟哟欧美精品| 欧美日韩国产成人在线91| 欧美在线视频日韩| 精品美女一区二区三区| 国产精品国产三级国产有无不卡 | 日本一区二区综合亚洲| 综合欧美亚洲日本| 另类成人小视频在线| 播五月开心婷婷综合| 色国产精品一区在线观看| 91精品国产综合久久香蕉的特点| 国产亚洲精品aa午夜观看| 亚洲天堂福利av| 国内外精品视频| 在线亚洲欧美专区二区| 欧美不卡一区二区| 亚洲摸摸操操av| 国产精品一二三区在线| 色诱亚洲精品久久久久久| 欧美高清www午色夜在线视频| 久久只精品国产| 午夜精品福利在线| 成人免费va视频| 国产日韩一级二级三级| 日韩va亚洲va欧美va久久| 99久久婷婷国产综合精品电影| 日韩欧美一区中文| 亚洲综合色噜噜狠狠| 成人精品视频一区二区三区| 欧美女孩性生活视频| 亚洲美女在线国产| 成人国产亚洲欧美成人综合网| 日韩欧美中文一区| 亚洲女爱视频在线| 色哟哟精品一区| 亚洲精品成人天堂一二三| 91久久奴性调教| 亚洲韩国精品一区| 欧美性受xxxx| 亚洲v精品v日韩v欧美v专区| 欧美主播一区二区三区美女| 亚洲成年人影院| 精品欧美一区二区在线观看| 国内精品国产成人国产三级粉色 | 色天天综合色天天久久| 亚洲国产精品麻豆| 日韩欧美国产不卡| 岛国av在线一区| 国产精品三级av在线播放| 成人综合在线观看| 亚洲人成影院在线观看| 欧美疯狂做受xxxx富婆| 国产很黄免费观看久久| 依依成人综合视频| 91在线观看成人| 国产乱码精品1区2区3区|