Package org.xwiki.extension

Examples of org.xwiki.extension.ExtensionId


        context.getProperties().put(RepositoryTestUtils.PROPERTY_KEY, repositoryTestUtil);
        context.getProperties().put(ExtensionTestUtils.PROPERTY_KEY, extensionTestUtil);

        // Populate maven repository
        File extensionFile =
            repositoryTestUtil.getTestExtension(new ExtensionId("emptyjar", "1.0"), "jar").getFile().getFile();
        FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(),
            "maven/extension/1.0/extension-1.0.jar"));
        FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(),
            "maven/extension/2.0/extension-2.0.jar"));
        FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(),
View Full Code Here


        super.setUp();

        // base extension informations

        this.baseExtension =
            getRepositoryTestUtils().getTestExtension(new ExtensionId(IDPREFIX + "macro-jar-extension", "1.0"), "jar");

        this.baseExtension.setName("Macro JAR extension");
        this.baseExtension.setDescription("extension description");
        this.baseExtension.setSummary("extension summary, **not bold**");

 
View Full Code Here

        Assert.assertTrue(extensionPage.isValidExtension());

        // 2.0

        TestExtension emptyExtension =
            getRepositoryTestUtils().getTestExtension(new ExtensionId("emptyjar", "1.0"), "jar");

        long fileSize = FileUtils.sizeOf(emptyExtension.getFile().getFile());

        ExtensionVersion extension =
            getUtil().getRESTResource(Resources.EXTENSION_VERSION, null, "maven:extension", "2.0");
View Full Code Here

     */
    @Test
    public void testRepositorySelector() throws Exception
    {
        // Setup the extension.
        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");
        getRepositoryTestUtils().addExtension(extension);

        // Check if the section links point to the right repository.
        ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
        Select repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("All Extensions", repositorySelect.getFirstSelectedOption().getText());

        adminPage = adminPage.clickCoreExtensionsSection();
        repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("Core extensions", repositorySelect.getFirstSelectedOption().getText());

        adminPage = adminPage.clickInstalledExtensionsSection();
        repositorySelect = adminPage.getSearchBar().getRepositorySelect();
        Assert.assertEquals("Installed extensions", repositorySelect.getFirstSelectedOption().getText());

        // Check that a remote extension appears only in the list of "All Extensions".
        SearchResultsPane searchResults = adminPage.getSearchBar().search("alice");
        Assert.assertNull(searchResults.getExtension(extensionId));

        new SimpleSearchPane().getRepositorySelect().selectByVisibleText("All Extensions");
        adminPage = new ExtensionAdministrationPage();
        adminPage.waitUntilPageIsLoaded();
        // The value of the search input must be preserved when we switch the repository.
        Assert.assertEquals("alice", adminPage.getSearchBar().getSearchInput().getAttribute("value"));
        Assert.assertNotNull(adminPage.getSearchResults().getExtension(extensionId));
        Assert.assertNull(new SimpleSearchPane().selectRepository("local").getExtension(extensionId));

        // Check that an installed extension appears also in "Installed Extensions" and "Local Extensions".
        getExtensionTestUtils().install(extensionId);
        adminPage = ExtensionAdministrationPage.gotoPage().clickInstalledExtensionsSection();
        searchResults = adminPage.getSearchBar().search("alice");
        Assert.assertNotNull(searchResults.getExtension(extensionId));
        Assert.assertNotNull(new SimpleSearchPane().selectRepository("local").getExtension(extensionId));
        Assert.assertNotNull(new SimpleSearchPane().selectRepository("").getExtension(extensionId));

        // Check local extension.
        getExtensionTestUtils().uninstall(extensionId.getId(), true);
        adminPage = ExtensionAdministrationPage.gotoPage().clickInstalledExtensionsSection();
        searchResults = adminPage.getSearchBar().search("alice");
        Assert.assertNull(searchResults.getExtension(extensionId));
        Assert.assertNotNull(new SimpleSearchPane().selectRepository("local").getExtension(extensionId));
        Assert.assertNotNull(new SimpleSearchPane().selectRepository("").getExtension(extensionId));
View Full Code Here

     */
    @Test
    public void testShowDetails() throws Exception
    {
        // Setup the extension.
        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");
        extension.setName("Alice Wiki Macro");
        extension.setSummary("A **useless** macro");
        extension.addAuthor(new DefaultExtensionAuthor("Thomas", null));
        extension.addAuthor(new DefaultExtensionAuthor("Marius", null));
        extension.addLicense(new ExtensionLicense("My own license", null));
        extension.setWebsite("http://www.alice.com");
        getRepositoryTestUtils().addExtension(extension);

        // Search the extension and assert the displayed information.
        ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
        ExtensionPane extensionPane =
            adminPage.getSearchBar().clickAdvancedSearch().search(extensionId).getExtension(0);
        Assert.assertEquals("remote", extensionPane.getStatus());
        Assert.assertNull(extensionPane.getStatusMessage());
        Assert.assertEquals(extension.getName(), extensionPane.getName());
        Assert.assertEquals(extensionId.getVersion().getValue(), extensionPane.getVersion());
        List<WebElement> authors = extensionPane.getAuthors();
        Assert.assertEquals(2, authors.size());
        Assert.assertEquals("Thomas", authors.get(0).getText());
        Assert.assertEquals("Marius", authors.get(1).getText());
        Assert.assertEquals(extension.getSummary(), extensionPane.getSummary());
View Full Code Here

     */
    @Test
    public void testDependencies() throws Exception
    {
        // Setup the extension and its dependencies.
        ExtensionId dependencyId = new ExtensionId("bob-xar-extension", "2.5-milestone-2");
        TestExtension dependency = getRepositoryTestUtils().getTestExtension(dependencyId, "xar");
        dependency.setName("Bob Wiki Macro");
        dependency.setSummary("Required by Alice");
        getRepositoryTestUtils().addExtension(dependency);

        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");
        extension.addDependency(new DefaultExtensionDependency(dependencyId.getId(), new DefaultVersionConstraint(
            dependencyId.getVersion().getValue())));
        extension.addDependency(new DefaultExtensionDependency("missing-dependency",
            new DefaultVersionConstraint("135")));
View Full Code Here

     */
    @Test
    public void testInstall() throws Exception
    {
        // Setup the extension and its dependencies.
        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");

        ExtensionId dependencyId = new ExtensionId("bob-xar-extension", "2.5-milestone-2");
        getRepositoryTestUtils().addExtension(getRepositoryTestUtils().getTestExtension(dependencyId, "xar"));
        extension.addDependency(new DefaultExtensionDependency(dependencyId.getId(), new DefaultVersionConstraint(
            dependencyId.getVersion().getValue())));

        extension.addDependency(new DefaultExtensionDependency("org.xwiki.platform:xwiki-platform-sheet-api",
            new DefaultVersionConstraint("[3.2,)")));
        getRepositoryTestUtils().addExtension(extension);

View Full Code Here

     */
    @Test
    public void testUninstall() throws Exception
    {
        // Setup the extension and its dependencies.
        ExtensionId dependencyId = new ExtensionId("bob-xar-extension", "2.5-milestone-2");
        getRepositoryTestUtils().addExtension(getRepositoryTestUtils().getTestExtension(dependencyId, "xar"));

        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        TestExtension extension = getRepositoryTestUtils().getTestExtension(extensionId, "xar");
        extension.addDependency(new DefaultExtensionDependency(dependencyId.getId(), new DefaultVersionConstraint(
            dependencyId.getVersion().getValue())));
        getRepositoryTestUtils().addExtension(extension);

View Full Code Here

     */
    @Test
    public void testInstallAndUninstallWithoutReload() throws Exception
    {
        // Setup the extension.
        ExtensionId extensionId = new ExtensionId("alice-xar-extension", "1.3");
        getRepositoryTestUtils().addExtension(getRepositoryTestUtils().getTestExtension(extensionId, "xar"));

        // Search the extension to install.
        ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
        ExtensionPane extensionPane =
View Full Code Here

        // Setup the extension.
        String extensionId = "alice-xar-extension";
        String oldVersion = "1.3";
        String newVersion = "2.1.4";
        TestExtension oldExtension =
            getRepositoryTestUtils().getTestExtension(new ExtensionId(extensionId, oldVersion), "xar");
        getRepositoryTestUtils().addExtension(oldExtension);
        TestExtension newExtension =
            getRepositoryTestUtils().getTestExtension(new ExtensionId(extensionId, newVersion), "xar");
        getRepositoryTestUtils().attachFile(newExtension);
        getRepositoryTestUtils().addVersionObject(newExtension, newVersion,
            "attach:" + newExtension.getFile().getName());

        // Make sure the old version is installed.
        getExtensionTestUtils().install(new ExtensionId(extensionId, oldVersion));

        // Upgrade the extension.
        ExtensionAdministrationPage adminPage = ExtensionAdministrationPage.gotoPage().clickAddExtensionsSection();
        ExtensionPane extensionPane =
            adminPage.getSearchBar().clickAdvancedSearch().search(extensionId, newVersion).getExtension(0);
View Full Code Here

TOP

Related Classes of org.xwiki.extension.ExtensionId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.