Package org.xwiki.xmlrpc.model

Examples of org.xwiki.xmlrpc.model.XWikiPageSummary


    public void testChangeParentId() throws Exception
    {
        // Find two pages where the second page isn't a child of the first page.
        List<XWikiPageSummary> pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        XWikiPageSummary pageSummary1 = pages.get(0);
        XWikiPageSummary pageSummary2 = null;
        for (XWikiPageSummary ps : pages) {
            if (!pageSummary1.getParentId().equals(ps.getId())) {
                pageSummary2 = ps;
            }
        }

        TestUtils.banner("TEST: changeParentId()");
        System.out.format("Setting page '%s' parent id to '%s'. Now: '%s'\n", pageSummary1.getId(),
            pageSummary2.getId(), pageSummary1.getParentId());
        XWikiPage page = this.rpc.getPage(pageSummary1.getId());
        assertNotSame(pageSummary2.getId(), page.getParentId());

        page.setParentId(pageSummary2.getId());
        page = this.rpc.storePage(page);

        System.out.format("New page: %s\n", page);

        assertEquals(pageSummary2.getId(), page.getParentId());
    }
View Full Code Here


    }

    public void testRemovePage() throws Exception
    {
        List<XWikiPageSummary> pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        XWikiPageSummary pageToBeDeleted = null;
        for (XWikiPageSummary pageSummary : pages) {
            if (pageSummary.getId().contains(TestConstants.TEST_PREFIX)) {
                pageToBeDeleted = pageSummary;
                break;
            }
        }

        Boolean result = this.rpc.removePage(pageToBeDeleted.getId());
        TestUtils.banner("TEST: removePage()");
        System.out.format("XWikiPage %s removed: %b\n", pageToBeDeleted.getId(), result);

        pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        boolean removed = true;
        for (PageSummary pageSummary : pages) {
            if (pageSummary.getId().equals(pageToBeDeleted.getId())) {
                removed = false;
                break;
            }
        }
View Full Code Here

    public void testChangeParentId() throws Exception
    {
        // Find two pages where the second page isn't a child of the first page.
        List<XWikiPageSummary> pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        XWikiPageSummary pageSummary1 = pages.get(0);
        XWikiPageSummary pageSummary2 = null;
        for (XWikiPageSummary ps : pages) {
            if (!pageSummary1.getParentId().equals(ps.getId())) {
                pageSummary2 = ps;
            }
        }

        TestUtils.banner("TEST: changeParentId()");
        System.out.format("Setting page '%s' parent id to '%s'. Now: '%s'\n", pageSummary1.getId(),
            pageSummary2.getId(), pageSummary1.getParentId());
        XWikiPage page = this.rpc.getPage(pageSummary1.getId());
        assertNotSame(pageSummary2.getId(), page.getParentId());

        page.setParentId(pageSummary2.getId());
        page = this.rpc.storePage(page);

        System.out.format("New page: %s\n", page);

        assertEquals(pageSummary2.getId(), page.getParentId());
    }
View Full Code Here

    }

    public void testRemovePage() throws Exception
    {
        List<XWikiPageSummary> pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        XWikiPageSummary pageToBeDeleted = null;
        for (XWikiPageSummary pageSummary : pages) {
            if (pageSummary.getId().contains(TestConstants.TEST_PREFIX)) {
                pageToBeDeleted = pageSummary;
                break;
            }
        }

        Boolean result = this.rpc.removePage(pageToBeDeleted.getId());
        TestUtils.banner("TEST: removePage()");
        System.out.format("XWikiPage %s removed: %b\n", pageToBeDeleted.getId(), result);

        pages = this.rpc.getPages(TestConstants.TEST_SPACE);
        boolean removed = true;
        for (PageSummary pageSummary : pages) {
            if (pageSummary.getId().equals(pageToBeDeleted.getId())) {
                removed = false;
                break;
            }
        }
View Full Code Here

TOP

Related Classes of org.xwiki.xmlrpc.model.XWikiPageSummary

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.