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

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

?? opencmstestcase.java

?? cms是開源的框架
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
            // log in the Admin user and switch to the setup project
            cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());
            cms.loginUser("Admin", "admin");
            cms.getRequestContext().setCurrentProject(cms.readProject("_setupProject"));

            if (importFolder != null) {
                // import the "simpletest" files
                importResources(cms, importFolder, targetFolder);
            }

            // create the default projects by script
            script = new File(getTestDataPath("scripts/script_default_projects.txt"));
            stream = new FileInputStream(script);
            m_shell.start(stream);

            if (publish) {
                // publish the current project by script
                script = new File(getTestDataPath("scripts/script_publish.txt"));
                stream = new FileInputStream(script);
                m_shell.start(stream);
            } else {
                cms.unlockProject(cms.readProject("_setupProject").getId());
            }

            // switch to the "Offline" project
            cms.getRequestContext().setCurrentProject(cms.readProject("Offline"));
            cms.getRequestContext().setSiteRoot("/sites/default/");

            // output a message 
            System.out.println("----- Starting test cases -----");
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            fail("Unable to setup OpenCms\n" + CmsException.getStackTraceAsString(t));
        }
        // turn on exceptions after error logging
        OpenCmsTestLogAppender.setBreakOnError(true);
        // return the initialized cms context Object
        return cms;
    }

    /**
     * Adds an additional path to the list of test data configuration files.<p>
     * 
     * @param dataPath the path to add
     */
    protected static synchronized void addTestDataPath(String dataPath) {

        // check if the db data folder is available
        File testDataFolder = new File(dataPath);
        if (!testDataFolder.exists()) {
            fail("DB setup data not available at " + testDataFolder.getAbsolutePath());
        }
        m_testDataPath.add(CmsFileUtil.normalizePath(testDataFolder.getAbsolutePath() + File.separator));
    }

    /**
     * Check the setup DB for errors that might have occured.<p>
     * 
     * @param setupDb the setup DB object to check
     */
    protected static void checkErrors(CmsSetupDb setupDb) {

        if (!setupDb.noErrors()) {
            Vector errors = setupDb.getErrors();
            for (Iterator i = errors.iterator(); i.hasNext();) {
                String error = (String)i.next();
                System.out.println(error);
            }
            fail((String)setupDb.getErrors().get(0));
        }
    }

    /**
     * Returns an initialized replacer map.<p>
     * 
     * @param connectionData the connection data to derive the replacer information
     * 
     * @return an initialized replacer map
     */
    protected static Map getReplacer(ConnectionData connectionData) {

        Map replacer = new HashMap();
        replacer.put("${database}", connectionData.m_dbName);
        replacer.put("${user}", connectionData.m_userName);
        replacer.put("${password}", connectionData.m_userPassword);
        replacer.put("${defaultTablespace}", m_defaultTablespace);
        replacer.put("${indexTablespace}", m_indexTablespace);
        replacer.put("${temporaryTablespace}", m_tempTablespace);

        return replacer;
    }

    /**
     * Returns the path to the data files used by the setup wizard.<p>
     * 
     * Whenever possible use this path to ensure that the files 
     * used for testing are actually the same as for the setup.<p>
     * 
     * @return the path to the data files used by the setup wizard
     */
    protected static synchronized String getSetupDataPath() {

        if (m_setupDataPath == null) {
            // check if the db setup files are available
            File setupDataFolder = new File(OpenCmsTestProperties.getInstance().getTestWebappPath());
            if (!setupDataFolder.exists()) {
                fail("DB setup data not available at " + setupDataFolder.getAbsolutePath());
            }
            m_setupDataPath = setupDataFolder.getAbsolutePath() + File.separator;
        }
        // return the path name
        return m_setupDataPath;
    }

    /**
     * Returns an initialized DB setup object.<p>
     * 
     * @param connection the connection data
     * 
     * @return the initialized setup DB object
     */
    protected static CmsSetupDb getSetupDb(ConnectionData connection) {

        // create setup DB instance
        CmsSetupDb setupDb = new CmsSetupDb(getSetupDataPath());

        // connect to the DB
        setupDb.setConnection(
            connection.m_jdbcDriver,
            connection.m_jdbcUrl,
            connection.m_jdbcUrlParams,
            connection.m_userName,
            connection.m_userPassword);

        // check for errors 
        if (!DB_ORACLE.equals(m_dbProduct)) {
            checkErrors(setupDb);
        }

        return setupDb;
    }

    /**
     * Returns the path to a file in the test data configuration, 
     * or <code>null</code> if the given file can not be found.<p>
     * 
     * This methods searches the given file in all configured test data paths.
     * It returns the file found first.<p>
     * 
     * @param filename the file name to look up
     * @return the path to a file in the test data configuration
     */
    protected static String getTestDataPath(String filename) {

        for (int i = 0; i < m_testDataPath.size(); i++) {

            String path = (String)m_testDataPath.get(i);
            File file = new File(path + filename);
            if (file.exists()) {
                if (file.isDirectory()) {
                    return file.getAbsolutePath() + File.separator;
                } else {
                    return file.getAbsolutePath();
                }
            }
        }

        return null;
    }

    /**
     * Imports a resource into the Cms.<p>
     * 
     * @param cms an initialized CmsObject
     * @param importFile the name (absolute Path) of the import resource (zip or folder)
     * @param targetPath the name (absolute Path) of the target folder in the VFS
     * @throws CmsException if something goes wrong
     */
    protected static void importResources(CmsObject cms, String importFile, String targetPath) throws CmsException {

        OpenCms.getImportExportManager().importData(
            cms,
            getTestDataPath(File.separator + "imports" + File.separator + importFile),
            targetPath,
            new CmsShellReport(cms.getRequestContext().getLocale()));
    }

    /**
     * Imports a resource from the RFS test directories to the VFS.<p> 
     * 
     * The imported resource will be automatically unlocked.<p>
     * 
     * @param cms the current users OpenCms context
     * @param rfsPath the RTF path of the resource to import, must be a path accessibly by the current class loader
     * @param vfsPath the VFS path for the imported resource
     * @param type the type for the imported resource
     * @param properties the properties for the imported resource
     * @return the imported resource
     * 
     * @throws Exception if the import fails
     */
    protected static CmsResource importTestResource(
        CmsObject cms,
        String rfsPath,
        String vfsPath,
        int type,
        List properties) throws Exception {

        byte[] content = CmsFileUtil.readFile(rfsPath);
        CmsResource result = cms.createResource(vfsPath, type, content, properties);
        cms.unlockResource(vfsPath);
        return result;
    }

    /**
     * Removes the OpenCms database test instance.<p>
     */
    protected static void removeDatabase() {

        if (m_defaultConnection != null) {
            removeDatabase(m_setupConnection, m_defaultConnection, false);
        }
        if (m_additionalConnection != null) {
            removeDatabase(m_setupConnection, m_additionalConnection, false);
        }
    }

    /**
     * Removes the OpenCms database test instance.<p>
     * 
     * @param setupConnection the setup connection
     * @param defaultConnection the default connection
     * @param handleErrors flag to indicate if errors should be handled/checked
     */
    protected static void removeDatabase(
        ConnectionData setupConnection,
        ConnectionData defaultConnection,
        boolean handleErrors) {

        CmsSetupDb setupDb = null;
        boolean noErrors = true;

        try {
            setupDb = getSetupDb(defaultConnection);
            setupDb.dropTables(m_dbProduct, getReplacer(defaultConnection), handleErrors);
            noErrors = setupDb.noErrors();
        } catch (Exception e) {
            noErrors = false;
        } finally {
            if (setupDb != null) {
                setupDb.closeConnection();
            }
        }

        if (!handleErrors || noErrors) {
            try {
                setupDb = getSetupDb(setupConnection);
                setupDb.dropDatabase(m_dbProduct, getReplacer(defaultConnection), handleErrors);
                setupDb.closeConnection();
            } catch (Exception e) {
                noErrors = false;
            } finally {
                if (setupDb != null) {
                    setupDb.closeConnection();
                }
            }
        }

        if (handleErrors) {
            checkErrors(setupDb);
        }
    }

    /**
     * Creates a new OpenCms test database including the tables.<p>
     * 
     * Any existing instance of the test database is forcefully removed first.<p>
     */
    protected static void setupDatabase() {

        if (m_defaultConnection != null) {
            setupDatabase(m_setupConnection, m_defaultConnection, true);
        }
        if (m_additionalConnection != null) {
            setupDatabase(m_setupConnection, m_additionalConnection, true);
        }
    }

    /**
     * Creates a new OpenCms test database including the tables.<p>
     * 
     * @param setupConnection the setup connection
     * @param defaultConnection the default connection
     * @param handleErrors flag to indicate if errors should be handled/checked
     */
    protected static void setupDatabase(
        ConnectionData setupConnection,
        ConnectionData defaultConnection,
        boolean handleErrors) {

        CmsSetupDb setupDb = null;
        boolean noErrors = true;

        try {
            setupDb = getSetupDb(setupConnection);
            setupDb.createDatabase(m_dbProduct, getReplacer(defaultConnection), handleErrors);
            noErrors = setupDb.noErrors();
            setupDb.closeConnection();
        } catch (Exception e) {
            noErrors = false;
        } finally {
            if (setupDb != null) {
                setupDb.closeConnection();
            }
        }

        if (!handleErrors || noErrors) {
            try {
                setupDb = getSetupDb(defaultConnection);
                setupDb.createTables(m_dbProduct, getReplacer(defaultConnection), handleErrors);
                noErrors = setupDb.noErrors();
                setupDb.closeConnection();
            } catch (Exception e) {
                noErrors = false;
            } finally {
                if (setupDb != null) {
                    setupDb.closeConnection();
                }
            }
        }

        if (noErrors) {
            return;
        } else if (handleErrors) {
            removeDatabase(setupConnection, defaultConnection, false);
            setupDatabase(setupConnection, defaultConnection, false);
        } else {
            checkErrors(setupDb);
        }
    }

    /**
     * Compares two lists of CmsProperty objects and creates a list of all properties which are

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲18色成人| 欧美一级日韩不卡播放免费| 久久久久久麻豆| 久久99久久久欧美国产| 久久精品一区二区三区不卡 | 亚洲电影在线播放| 欧美男女性生活在线直播观看 | 蜜桃精品在线观看| 久久久久久亚洲综合影院红桃| 国产成人综合亚洲91猫咪| 国产精品久久夜| 91视视频在线直接观看在线看网页在线看| 国产精品久久久一本精品 | 精品一区二区三区蜜桃| 久久天天做天天爱综合色| 福利91精品一区二区三区| 亚洲欧洲日本在线| 欧美狂野另类xxxxoooo| 亚洲欧美激情视频在线观看一区二区三区 | 91久久香蕉国产日韩欧美9色| 亚洲美女少妇撒尿| 在线成人av网站| 国产资源在线一区| 亚洲精品视频在线看| 91精品欧美一区二区三区综合在| 久久精品国产精品青草| 国产精品久久久久久久久图文区 | 免费高清成人在线| 国产亚洲欧美一区在线观看| 在线一区二区观看| 久久99精品一区二区三区三区| 国产精品国产三级国产aⅴ中文| 97精品超碰一区二区三区| 亚洲福中文字幕伊人影院| 久久夜色精品国产欧美乱极品| 91视频一区二区三区| 蜜臀av一区二区三区| 亚洲欧美欧美一区二区三区| 精品久久国产字幕高潮| 在线观看视频一区| 豆国产96在线|亚洲| 性欧美疯狂xxxxbbbb| 久久精子c满五个校花| 91麻豆精品国产91| 91免费看视频| 国产成人丝袜美腿| 日韩精品欧美精品| 伊人色综合久久天天| 国产午夜精品理论片a级大结局| 精品视频色一区| 91小视频在线免费看| 高清免费成人av| 经典三级视频一区| 蜜臀av性久久久久蜜臀aⅴ| 亚洲愉拍自拍另类高清精品| 亚洲欧洲精品天堂一级| 中文字幕欧美国产| 国产成人在线看| 亚洲成人免费视频| 中文字幕一区二区三区在线播放| 日韩美一区二区三区| 欧美日韩电影在线播放| 色综合激情久久| 9l国产精品久久久久麻豆| 久久99精品久久只有精品| 日本成人在线网站| 日日夜夜精品免费视频| 亚洲国产日韩在线一区模特| 一区二区在线观看免费视频播放| 国产精品嫩草影院av蜜臀| 久久亚洲春色中文字幕久久久| 日韩三级视频在线看| 91精品国产综合久久国产大片| 欧美撒尿777hd撒尿| 色婷婷综合久久| 色综合久久久久网| 91福利在线播放| 日本高清成人免费播放| 色婷婷久久久久swag精品| 色综合久久88色综合天天6| 91日韩在线专区| 日韩中文字幕av电影| 欧美片在线播放| 在线影院国内精品| 欧美日韩国产综合一区二区| 国产在线精品视频| 丝袜亚洲另类欧美| 欧美日韩国产影片| 99re热这里只有精品视频| 国模大尺度一区二区三区| 成人免费小视频| 亚洲欧美怡红院| 夜夜精品浪潮av一区二区三区| 亚洲精品国产一区二区三区四区在线| 最新国产の精品合集bt伙计| 中文字幕一区av| 亚洲一二三四区不卡| 亚洲成人一区二区在线观看| 偷拍一区二区三区四区| 久久国产视频网| 成人激情免费网站| 波多野结衣在线一区| 国产精品美女久久久久久久 | 久久久久久9999| 国产日产欧美一区二区视频| 国产精品动漫网站| 亚洲一区二区三区四区的| 日av在线不卡| 成人免费毛片高清视频| 在线视频国内一区二区| 日韩一区二区三区视频| 国产亲近乱来精品视频| 一区二区三区成人| 麻豆精品一区二区综合av| 成人app在线| 欧美一级电影网站| 国产精品第13页| 秋霞电影一区二区| 成人免费av网站| 4hu四虎永久在线影院成人| 欧美经典一区二区三区| 亚洲v日本v欧美v久久精品| 国产一区二区三区视频在线播放| 色哟哟一区二区在线观看| 日韩欧美一二三| 亚洲精品va在线观看| 精品一区二区免费| 欧洲亚洲国产日韩| 中文字幕欧美激情| 久久激情综合网| 一本色道久久综合狠狠躁的推荐| 精品乱人伦小说| 亚洲成人av福利| 色综合久久久久| 欧美国产欧美综合| 久久精品国产一区二区三 | 国产精品久久久久一区二区三区| 一区二区在线观看不卡| 国产在线国偷精品产拍免费yy| 91女人视频在线观看| 国产亚洲欧洲一区高清在线观看| 亚洲国产aⅴ成人精品无吗| 国产精品一区二区三区网站| 欧美精品第1页| 亚洲一区二区三区视频在线| youjizz国产精品| 久久综合九色欧美综合狠狠| 日韩精品高清不卡| 91黄色小视频| 国产精品不卡在线观看| 国产九九视频一区二区三区| 日韩三级视频在线观看| 亚洲成人免费视频| 欧美日韩一区二区三区高清 | 午夜久久久久久电影| 91在线视频网址| 国产很黄免费观看久久| 中文字幕视频一区| 国产麻豆视频一区| 精品乱人伦小说| 蜜臀a∨国产成人精品| 欧美日本一区二区三区四区| 一区二区三区中文字幕| 91麻豆国产福利精品| 中文字幕佐山爱一区二区免费| 成人自拍视频在线观看| 国产欧美一区二区精品忘忧草| 国产一区在线精品| 精品国产乱码久久| 狠狠色丁香婷综合久久| 久久久国产精品午夜一区ai换脸| 国产一区二区伦理片| 久久久久久9999| 波多野结衣一区二区三区| 亚洲国产精品精华液2区45| 大尺度一区二区| 亚洲欧洲在线观看av| 91在线播放网址| 亚洲一区二区三区中文字幕| 欧美日韩中文精品| 日韩精品一区第一页| 日韩午夜在线影院| 国产一区二区精品久久91| 国产网站一区二区| 99久久免费国产| 亚洲一区二区在线视频| 欧美久久久久久久久中文字幕| 卡一卡二国产精品| 欧美日韩不卡在线| 免费在线观看精品| 久久综合色之久久综合| 成人午夜精品一区二区三区| 亚洲免费大片在线观看| 欧美日韩亚洲高清一区二区| 麻豆成人久久精品二区三区小说| 精品久久久久久久久久久院品网 | 国产精品看片你懂得| 在线影院国内精品| 免费在线观看一区| 国产精品蜜臀在线观看|