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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区中文字幕| 自拍偷自拍亚洲精品播放| 91福利精品第一导航| 成人午夜视频在线| 国产在线精品不卡| 高清beeg欧美| 成人综合在线网站| av电影一区二区| 色婷婷综合久久| 在线一区二区三区四区五区| 欧美另类videos死尸| thepron国产精品| 成人黄色在线看| 91蜜桃传媒精品久久久一区二区| caoporn国产精品| 欧美性感一区二区三区| 欧美美女一区二区在线观看| 欧美一区二区三区影视| 精品日韩欧美在线| 亚洲国产精品精华液2区45| ㊣最新国产の精品bt伙计久久| 亚洲图片你懂的| 五月婷婷综合网| 久久国产欧美日韩精品| 成人综合婷婷国产精品久久免费| 97成人超碰视| 91精品在线免费观看| 久久综合九色综合欧美98 | 亚洲综合偷拍欧美一区色| 亚洲综合久久av| 久久99精品国产麻豆不卡| 成人精品高清在线| 6080日韩午夜伦伦午夜伦| 久久久久久久久岛国免费| 亚洲精品久久嫩草网站秘色| 毛片一区二区三区| 色一区在线观看| www久久精品| 一区二区激情视频| 国产乱码字幕精品高清av| 色94色欧美sute亚洲线路一ni| 91麻豆精品国产91久久久久久| 国产欧美精品区一区二区三区| 一区二区三区四区视频精品免费| 久久国产欧美日韩精品| 91福利精品第一导航| 久久久久久久久久电影| 秋霞电影网一区二区| 成人av在线一区二区三区| 欧美二区三区的天堂| 中文字幕亚洲综合久久菠萝蜜| 麻豆精品国产传媒mv男同| 在线欧美一区二区| 中文成人av在线| 精品夜夜嗨av一区二区三区| 欧美专区在线观看一区| 国产精品美女久久久久久2018| 另类中文字幕网| 精品少妇一区二区| 日韩国产欧美视频| 色综合视频一区二区三区高清| 久久久777精品电影网影网| 午夜伊人狠狠久久| 91成人免费在线| 亚洲视频免费看| 成人激情图片网| 中日韩免费视频中文字幕| 国产黄人亚洲片| 精品国产污网站| 另类小说欧美激情| 精品国产第一区二区三区观看体验 | www.在线成人| 国产亚洲精久久久久久| 国产一区三区三区| xfplay精品久久| 国产精品亚洲一区二区三区妖精| 日韩三级视频在线观看| 美女脱光内衣内裤视频久久网站| 欧美特级限制片免费在线观看| 亚洲裸体在线观看| 欧美在线播放高清精品| 亚洲三级电影全部在线观看高清| 不卡av在线网| 一二三区精品福利视频| 色网综合在线观看| 亚洲国产aⅴ成人精品无吗| 日本福利一区二区| 同产精品九九九| 欧美精品在线观看一区二区| 日韩高清一级片| 日韩免费一区二区| 国产美女av一区二区三区| 亚洲精品亚洲人成人网在线播放| 91在线免费看| 亚洲网友自拍偷拍| 日韩女优毛片在线| 国产宾馆实践打屁股91| 亚洲另类春色校园小说| 91精品欧美综合在线观看最新 | 国产一区二区三区电影在线观看 | 欧美a级一区二区| 久久综合色一综合色88| 99re热这里只有精品免费视频| 玉米视频成人免费看| 日韩欧美国产一二三区| 丁香婷婷综合色啪| 亚洲一区在线视频| 日韩你懂的在线播放| 99精品久久99久久久久| 日韩av中文字幕一区二区| 国产拍揄自揄精品视频麻豆| 不卡在线视频中文字幕| 日本欧美一区二区三区乱码| 日本一区二区在线不卡| 欧美日韩第一区日日骚| 成人爱爱电影网址| 麻豆精品国产传媒mv男同| 亚洲乱码日产精品bd| 日韩欧美黄色影院| 色国产综合视频| 国产福利一区二区三区视频| 亚洲h在线观看| 最新国产精品久久精品| 欧美xxx久久| 3d动漫精品啪啪一区二区竹菊| 成人动漫视频在线| 免费观看久久久4p| 一二三四区精品视频| 国产精品久久久久影视| 欧美不卡激情三级在线观看| 在线视频国产一区| 成人性生交大合| 国产福利一区二区| 国产在线播放一区二区三区| 午夜亚洲福利老司机| 亚洲精品乱码久久久久久久久| 国产三级久久久| 精品国产123| 91精品蜜臀在线一区尤物| 91久久线看在观草草青青| 成人午夜电影网站| 国产真实乱子伦精品视频| 免费成人在线影院| 免费人成黄页网站在线一区二区| 亚洲二区在线视频| 亚洲影视在线观看| 一区二区三区在线视频播放| 日韩美女视频一区| 亚洲人亚洲人成电影网站色| 国产精品乱码一区二区三区软件 | 狠狠色综合日日| 麻豆极品一区二区三区| 日本va欧美va精品发布| 午夜精品久久久久久久| 日韩精品一二区| 视频在线观看91| 免费观看30秒视频久久| 精品在线一区二区三区| 极品少妇xxxx精品少妇| 国内成+人亚洲+欧美+综合在线| 精品一区二区三区在线观看国产| 久久se精品一区二区| 国产一区欧美一区| 成人精品视频.| 日本道色综合久久| 欧美日韩免费电影| 日韩免费视频一区| 国产网红主播福利一区二区| 国产精品久久免费看| 一区二区在线观看免费| 亚洲一级电影视频| 麻豆精品久久久| 国产精品一二三| 色婷婷国产精品| 91精品福利在线一区二区三区| 欧美mv和日韩mv国产网站| 欧美国产精品中文字幕| 亚洲综合网站在线观看| 蜜臀va亚洲va欧美va天堂| 国产激情一区二区三区桃花岛亚洲| 成人av集中营| 91麻豆精品久久久久蜜臀| 国产午夜亚洲精品理论片色戒| 亚洲视频一二三区| 久久国产麻豆精品| av在线播放不卡| 日韩欧美一二三四区| 亚洲三级在线看| 六月丁香综合在线视频| 91免费观看在线| 欧美成人性战久久| 自拍偷拍亚洲综合| 精品一区二区三区在线观看国产| 99视频热这里只有精品免费| 在线综合亚洲欧美在线视频| 国产精品日韩精品欧美在线| 蜜臀av性久久久久蜜臀aⅴ| 成人高清视频免费观看| 日韩精品一区在线| 亚洲在线视频免费观看|