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

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

?? testmoduleoperations.java

?? cms是開(kāi)源的框架
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
        if (dependencies.size() != 1) {
            fail("Module '" + moduleName + "' still needs 1 dependency, not " + dependencies.size());
        }

        if (!dependencies.contains(dep2)) {
            fail("Missing required dependency: " + dep2);
        }

        // finally add depdendency with right version
        addDependency(cms, dep2);

        dependencies = OpenCms.getModuleManager().checkDependencies(module, CmsModuleManager.DEPENDENCY_MODE_IMPORT);

        if (dependencies.size() != 0) {
            fail("Module '" + moduleName + "' must have dependencies fullfilled");
        }

        // now try the import again, this time it must work
        OpenCms.getImportExportManager().importData(cms, moduleFile, null, new CmsShellReport(cms.getRequestContext().getLocale()));

        module = OpenCms.getModuleManager().getModule(moduleName);
        // check the module data
        assertEquals(module.getNiceName(), "OpenCms configuration test module 2");
        assertEquals(module.getDescription(), "Test 2 for the OpenCms module import");
        assertEquals(module.getVersion(), new CmsModuleVersion("1.5"));
        assertTrue(module.getActionClass() == null);
        assertEquals(module.getAuthorName(), "Alexander Kandzior");
        assertEquals(module.getAuthorEmail(), "alex@opencms.org");
        assertEquals(module.getExportPoints().size(), 2);
        assertEquals(module.getResources().size(), 1);
        assertEquals(module.getResources().get(0), "/system/modules/org.opencms.test.modules.test2/");
        assertEquals(module.getParameter("param1"), "value1");
        assertEquals(module.getParameter("param2"), "value2");

        // now try to delete the dependencies, this must generate an error
        caughtException = false;
        try {
            OpenCms.getModuleManager().deleteModule(cms, dep1.getName(), false, new CmsShellReport(cms.getRequestContext().getLocale()));
        } catch (CmsConfigurationException e) {
            caughtException = true;
        }
        if (!caughtException) {
            fail("Deleting '" + dep1.getName() + "' must generate an error");
        }
        caughtException = false;
        try {
            OpenCms.getModuleManager().deleteModule(cms, dep2.getName(), false, new CmsShellReport(cms.getRequestContext().getLocale()));
        } catch (CmsConfigurationException e) {
            caughtException = true;
        }
        if (!caughtException) {
            fail("Deleting '" + dep2.getName() + "' must generate an error");
        }

        CmsModuleDependency dep4 = new CmsModuleDependency(
            "org.opencms.test.modules.test2",
            new CmsModuleVersion("1.5"));

        module = OpenCms.getModuleManager().getModule(dep1.getName());
        dependencies = OpenCms.getModuleManager().checkDependencies(module, CmsModuleManager.DEPENDENCY_MODE_DELETE);
        if (!dependencies.contains(dep4)) {
            fail("Dependency not checked: " + dep4);
        }

        module = OpenCms.getModuleManager().getModule(dep2.getName());
        dependencies = OpenCms.getModuleManager().checkDependencies(module, CmsModuleManager.DEPENDENCY_MODE_DELETE);
        if (!dependencies.contains(dep4)) {
            fail("Dependency not checked: " + dep4);
        }

        // delete the imported module
        OpenCms.getModuleManager().deleteModule(cms, moduleName, false, new CmsShellReport(cms.getRequestContext().getLocale()));

        // delete the dependencies (must work now since dependency is removed)
        OpenCms.getModuleManager().deleteModule(cms, dep1.getName(), false, new CmsShellReport(cms.getRequestContext().getLocale()));
        OpenCms.getModuleManager().deleteModule(cms, dep2.getName(), false, new CmsShellReport(cms.getRequestContext().getLocale()));

        // publish the current project
        cms.publishProject();
    }

    /**
     * Tests a module export (and then re-import).<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testModuleExport() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing export an re-import of a module");

        String moduleName = "org.opencms.test.modules.testExport";

        String moduleFile = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
            "packages/" + moduleName + ".zip");
        File file = new File(moduleFile);
        if (file.exists()) {
            // probably from a old test run that didn't end with a success
            file.delete();
        }

        CmsModule module = new CmsModule(
            moduleName,
            "A test module for export",
            "ModuleGroup",
            null,
            "This is the description",
            new CmsModuleVersion("1.0"),
            "Alexander Kandzior",
            "alex@opencms.org",
            System.currentTimeMillis(),
            null,
            0L,
            null,
            null,
            null,
            null);

        // add the module to the module manager
        OpenCms.getModuleManager().addModule(cms, module);

        // basic check if the module was created correctly
        if (!OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not created!");
        }

        // generate a module export handler
        CmsModuleImportExportHandler moduleExportHandler = new CmsModuleImportExportHandler();
        moduleExportHandler.setFileName(moduleFile);
        moduleExportHandler.setAdditionalResources(new String[0]);
        moduleExportHandler.setModuleName(moduleName.replace('\\', '/'));
        moduleExportHandler.setDescription("Module export of " + moduleExportHandler.getModuleName());

        // export the module
        OpenCms.getImportExportManager().exportData(cms, moduleExportHandler, new CmsShellReport(cms.getRequestContext().getLocale()));

        // now delete the module from the manager
        OpenCms.getModuleManager().deleteModule(cms, moduleName, false, new CmsShellReport(cms.getRequestContext().getLocale()));

        // ensure that the module was deleted
        if (OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not deleted!");
        }

        // now import the module again
        OpenCms.getImportExportManager().importData(cms, moduleFile, null, new CmsShellReport(cms.getRequestContext().getLocale()));

        // basic check if the module was imported correctly
        if (!OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not imported!");
        }

        CmsModule importedModule = OpenCms.getModuleManager().getModule(moduleName);
        // now check the other module data
        if (!module.isIdentical(importedModule)) {
            fail("Impoted module not identical to original module!");
        }

        if (file.exists()) {
            // clean up
            file.delete();
        } else {
            fail("Module export file was not written to expected location!");
        }
    }

    /**
     * Tests a module import.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testModuleImport() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing import of a module");

        String moduleName = "org.opencms.test.modules.test1";

        String moduleFile = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
            "packages/" + moduleName + ".zip");
        OpenCms.getImportExportManager().importData(cms, moduleFile, null, new CmsShellReport(cms.getRequestContext().getLocale()));

        // basic check if the module was imported correctly
        if (!OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not imported!");
        }

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        // now check the other module data
        assertEquals(module.getNiceName(), "OpenCms configuration test module 1");
        assertEquals(module.getDescription(), "Test 1 for the OpenCms module import");
        assertEquals(module.getVersion(), new CmsModuleVersion("1.0"));
        assertTrue(module.getActionClass() == null);
        assertEquals(module.getAuthorName(), "Alexander Kandzior");
        assertEquals(module.getAuthorEmail(), "alex@opencms.org");
        assertEquals(module.getExportPoints().size(), 2);
        assertEquals(module.getResources().size(), 1);
        assertEquals(module.getResources().get(0), "/system/modules/org.opencms.test.modules.test1/");
        assertEquals(module.getParameter("param1"), "value1");
        assertEquals(module.getParameter("param2"), "value2");
    }

    /**
     * Tests a module import with an unknown resource type class.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testModuleImportMissingResTypeClass() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing a module import with an unknown resource type class");

        String moduleName = "org.opencms.test.modules.test4";

        String moduleFile = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
            "packages/" + moduleName + ".zip");
        
        try {
            // importing this module will generate an expected error in the log
            OpenCmsTestLogAppender.setBreakOnError(false);
            OpenCms.getImportExportManager().importData(cms, moduleFile, null, new CmsShellReport(cms.getRequestContext().getLocale()));
        } finally {
            OpenCmsTestLogAppender.setBreakOnError(true);            
        }

        // basic check if the module was imported correctly
        if (!OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not imported!");
        }

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        // now check the other module data
        assertEquals(module.getNiceName(), "OpenCms configuration test module 4");
        assertEquals(module.getDescription(), "Test 4 for the OpenCms module import: Missing classes");
        assertEquals(module.getVersion(), new CmsModuleVersion("1.0"));
        assertEquals(module.getActionClass(), "org.opencms.missing.moduleClass");
        assertEquals(module.getAuthorName(), "Alexander Kandzior");
        assertEquals(module.getAuthorEmail(), "alex@opencms.org");
        assertEquals(module.getExportPoints().size(), 0);
        assertEquals(module.getResources().size(), 0);
        assertEquals(module.getParameter("param1"), "value1");
        assertEquals(module.getParameter("param2"), "value2");
                
        // check for the new resource type
        I_CmsResourceType missingType = OpenCms.getResourceManager().getResourceType("missing");
        assertNotNull(missingType);
        // check configured and actual class name
        assertEquals(missingType.getClassName(), "org.opencms.missing.resourceTypeClass");
        assertEquals(missingType.getTypeId(), 88);
        assertEquals(missingType.getLoaderId(), CmsDumpLoader.RESOURCE_LOADER_ID);
        assertEquals(missingType.getClass().getName(), CmsResourceTypeUnknown.class.getName());
    }
    
    /**
     * Tests a module import of an old (OpenCms 5.0) style module.<p>
     * 
     * @throws Throwable if something goes wrong
     */
    public void testOldModuleImport() throws Throwable {

        CmsObject cms = getCmsObject();
        echo("Testing import of an old OpenCms 5.0 module");

        String moduleName = "org.opencms.test.modules.testOld";

        String moduleFile = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
            "packages/" + moduleName + ".zip");
        OpenCms.getImportExportManager().importData(cms, moduleFile, null, new CmsShellReport(cms.getRequestContext().getLocale()));

        // basic check if the module was imported correctly
        if (!OpenCms.getModuleManager().hasModule(moduleName)) {
            fail("Module '" + moduleName + "' was not imported!");
        }

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        // now check the other module data
        assertEquals(module.getNiceName(), "OpenCms v5.0 test module");
        assertEquals(
            module.getDescription().trim(),
            "This is a module in the OpenCms v5.0.x style.\n\t\tThe XML format for modules has changed in OpenCms 6.0.");
        assertEquals(module.getVersion(), new CmsModuleVersion("2.05"));
        assertTrue(module.getActionClass() == null);
        assertEquals(module.getAuthorName(), "Alexander Kandzior");
        assertEquals(module.getAuthorEmail(), "alex@opencms.org");
        // check if "additionalresources" where converted to module resources        
        assertTrue(module.getResources().size() == 2);
        assertEquals(module.getResources().get(0), "/system/modules/org.opencms.test.modules.testOld/");
        assertEquals(module.getResources().get(1), "/alkacon-documentation/documentation-flexcache/");
    }

    /**
     * Adds a module dependency for the tests.<p>
     * 
     * @param cms the current OpenCms context
     * @param dep the dependency to check
     * 
     * @throws CmsConfigurationException in case something goes wrong
     * @throws CmsSecurityException in case something goes wrong
     */
    private void addDependency(CmsObject cms, CmsModuleDependency dep)
    throws CmsSecurityException, CmsConfigurationException {

        if (OpenCms.getModuleManager().hasModule(dep.getName())) {
            // remove other version of dependency if it exists
            OpenCms.getModuleManager().deleteModule(cms, dep.getName(), true, new CmsShellReport(cms.getRequestContext().getLocale()));
        }

        CmsModule module = new CmsModule(
            dep.getName(),
            "A test module dependency",
            "ModuleGroup",
            null,
            null,
            dep.getVersion(),
            "Alexander Kandzior",
            "alex@opencms.org",
            System.currentTimeMillis(),
            null,
            0L,
            null,
            null,
            null,
            null);

        // add the module to the module manager
        OpenCms.getModuleManager().addModule(cms, module);
    }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色倩网站大全免费| 欧美不卡一区二区三区四区| 伦理电影国产精品| 国产精品久久久久久久久免费丝袜| 欧美日韩久久久一区| 成人午夜视频在线| 日本不卡123| 亚洲一区视频在线| 亚洲婷婷综合久久一本伊一区 | 日韩精品资源二区在线| av电影天堂一区二区在线观看| 日韩国产在线观看一区| 樱花草国产18久久久久| 国产日韩欧美麻豆| 日韩片之四级片| 欧美性猛片xxxx免费看久爱| 不卡高清视频专区| 精品无人码麻豆乱码1区2区| 夜夜亚洲天天久久| 亚洲天堂福利av| 国产精品日产欧美久久久久| 日韩精品一区二区三区四区视频| 欧美性色综合网| 色综合久久中文字幕| 成人一区二区在线观看| 国产综合色视频| 另类小说视频一区二区| 五月激情综合婷婷| 亚洲图片有声小说| 亚洲国产日韩综合久久精品| 1000部国产精品成人观看| 国产目拍亚洲精品99久久精品| 日韩欧美高清dvd碟片| 91精品国模一区二区三区| 欧美日韩免费高清一区色橹橹| 一本大道久久精品懂色aⅴ| av电影一区二区| 99亚偷拍自图区亚洲| 成人免费视频一区二区| 成人免费看片app下载| 懂色av一区二区三区蜜臀| 国产在线一区二区| 国产裸体歌舞团一区二区| 国产在线视视频有精品| 国产美女一区二区| 国产成人精品三级| 成人一区二区三区视频在线观看 | 日韩精品色哟哟| 天天综合色天天| 男男成人高潮片免费网站| 免费高清成人在线| 国产老女人精品毛片久久| 国产成人在线观看免费网站| 成人手机在线视频| 色综合天天综合狠狠| 欧美午夜不卡在线观看免费| 在线播放/欧美激情| 精品国产免费一区二区三区四区| 久久综合狠狠综合久久激情| 中文字幕第一区| 亚洲日本韩国一区| 视频在线观看一区| 国产一区二区主播在线| 成人美女视频在线看| 91激情在线视频| 69av一区二区三区| 久久久91精品国产一区二区三区| 欧美国产成人在线| 亚洲一区欧美一区| 久久成人精品无人区| 高清成人免费视频| 欧洲国内综合视频| 精品国产伦一区二区三区观看体验| 久久久久久毛片| 亚洲激情自拍偷拍| 精品一区二区影视| 色综合天天综合网天天看片 | 欧美高清在线精品一区| 亚洲精品国产精品乱码不99| 日韩高清不卡一区二区三区| 福利一区二区在线| 欧美在线999| 久久久久国产免费免费| 一区二区欧美视频| 国产黄人亚洲片| 欧美日韩激情一区| 国产免费成人在线视频| 亚洲午夜久久久久久久久电影网| 寂寞少妇一区二区三区| 在线观看一区二区精品视频| 26uuu另类欧美| 一区二区免费在线| 国产高清精品网站| 欧美福利视频导航| 中文字幕一区二区三区蜜月| 视频一区在线视频| 91麻豆免费看| 精品福利一区二区三区免费视频| 尤物视频一区二区| 国产乱码精品一区二区三区五月婷 | 欧美极品xxx| 日韩福利电影在线观看| 91在线视频播放地址| 久久综合丝袜日本网| 午夜久久电影网| av电影一区二区| 久久九九99视频| 美女国产一区二区| 欧美三级三级三级爽爽爽| 欧美激情中文不卡| 极品瑜伽女神91| 91精品国产黑色紧身裤美女| 亚洲欧美日韩国产综合| 国产成人在线免费| 亚洲精品一区在线观看| 五月婷婷综合在线| 91黄色激情网站| 亚洲色图20p| 成av人片一区二区| 欧美国产日产图区| 国产精品1区2区3区| 26uuu亚洲综合色欧美 | 久久99久久99小草精品免视看| 欧美性大战久久| 一片黄亚洲嫩模| 99re成人精品视频| 成人免费小视频| 成人一区二区三区视频| 久久久国产精华| 国产一区二区调教| 精品久久一二三区| 韩国精品久久久| 精品处破学生在线二十三| 美女任你摸久久| 精品国产乱码久久久久久牛牛| 日本午夜一区二区| 日韩欧美国产一区二区在线播放| 日本在线不卡一区| 91精品国产色综合久久ai换脸 | 99国产精品99久久久久久| 国产精品护士白丝一区av| 99国产精品国产精品毛片| 亚洲欧洲三级电影| 日本高清不卡aⅴ免费网站| 亚洲激情第一区| 欧美性生活一区| 日韩电影一区二区三区| 日韩一二三区不卡| 国产一区三区三区| 国产精品三级视频| 91热门视频在线观看| 亚洲激情图片一区| 欧美军同video69gay| 麻豆国产欧美日韩综合精品二区| 日韩三级视频中文字幕| 黄页视频在线91| 国产精品视频在线看| 91老司机福利 在线| 亚洲成人动漫精品| 精品少妇一区二区三区免费观看 | 国产盗摄一区二区| 最新中文字幕一区二区三区 | 成人网在线播放| 亚洲精品菠萝久久久久久久| 在线看国产一区| 精一区二区三区| 国产精品你懂的| 欧美日韩国产电影| 国产美女一区二区三区| 亚洲人亚洲人成电影网站色| 欧美精品在线观看一区二区| 精品一区二区在线看| 亚洲青青青在线视频| 欧美一级黄色大片| 国产91精品一区二区麻豆网站| 一区二区三区四区乱视频| 日韩午夜在线影院| 91亚洲大成网污www| 日本色综合中文字幕| 国产欧美日韩另类一区| 欧美日韩高清在线播放| 国产精品羞羞答答xxdd| 亚洲国产精品综合小说图片区| 精品国产百合女同互慰| 色哟哟在线观看一区二区三区| 久久国产精品99精品国产| 日韩毛片高清在线播放| 精品免费视频一区二区| 日本韩国精品一区二区在线观看| 久久国产福利国产秒拍| 一区二区三区中文字幕精品精品| 精品国产乱码久久久久久影片| 日本高清视频一区二区| 国产成人精品一区二区三区四区| 亚洲成精国产精品女| 国产精品高潮呻吟久久| 精品久久久久久久人人人人传媒| 91成人国产精品| 高清不卡一二三区| 美女看a上一区|