Package org.xwiki.xmlrpc.model

Examples of org.xwiki.xmlrpc.model.XWikiPageHistorySummary


    }

    public void testGetPageAtVersion() throws Exception
    {
        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getPageHistory(TestConstants.TEST_PAGE);
        XWikiPageHistorySummary pageHistorySummary =
            pageHistorySummaries.get(this.random.nextInt(pageHistorySummaries.size()));

        XWikiPage page = this.rpc.getPage(TestConstants.TEST_PAGE, pageHistorySummary.getVersion());
        TestUtils.banner("TEST: getPageAtVersion()");
        System.out.format("%s\n", pageHistorySummary);
        System.out.format("%s\n", page);

        assertEquals(pageHistorySummary.getVersion(), page.getVersion());
        assertEquals(pageHistorySummary.getModifier(), page.getModifier());

        /*
         * This test occasionally fails because the version returned as the modification date by XWiki when getting a
         * page with a given version is always equal to the current date/time. So if the previous version to
         * getPageHistory is made, let's say at 12:53:59 and the subsequent getPage at 12:54:01 then the date in the
View Full Code Here


    }

    public void testGetPageAtVersionUsingExtendedId() throws Exception
    {
        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getPageHistory(TestConstants.TEST_PAGE);
        XWikiPageHistorySummary pageHistorySummary =
            pageHistorySummaries.get(this.random.nextInt(pageHistorySummaries.size()));

        XWikiPage page = this.rpc.getPage(pageHistorySummary.getId());
        TestUtils.banner("TEST: getPageAtVersionUsingExtendedId()");
        System.out.format("%s\n", pageHistorySummary);
        System.out.format("%s\n", page);

        assertEquals(pageHistorySummary.getVersion(), page.getVersion());
        assertEquals(pageHistorySummary.getModifier(), page.getModifier());
    }
View Full Code Here

        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getModifiedPagesHistory(30, 0, true);

        TestUtils.banner("TEST: getModifiedPageHistoryMultipleRequests()");
        for (int i = 0; i < pageHistorySummaries.size(); i++) {
            XWikiPageHistorySummary h1 = pageHistorySummaries.get(i);
            XWikiPageHistorySummary h2 = result.get(i);

            assertTrue(h1.getId().equals(h2.getId()));
            assertTrue(h1.getModifier().equals(h2.getModifier()));
            assertTrue(h1.getModified().equals(h2.getModified()));
            assertTrue(h1.getVersion() == h2.getVersion());
            assertTrue(h1.getMinorVersion() == h2.getMinorVersion());
        }

        long t = Long.MAX_VALUE;
        for (XWikiPageHistorySummary pageHistorySummary : result) {
            assertTrue(pageHistorySummary.getModified().getTime() <= t);
View Full Code Here

    }

    public void testGetPageAtVersionUsingExtendedId() throws Exception
    {
        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getPageHistory(TestConstants.TEST_PAGE);
        XWikiPageHistorySummary pageHistorySummary =
            pageHistorySummaries.get(this.random.nextInt(pageHistorySummaries.size()));

        XWikiPage page = this.rpc.getPage(pageHistorySummary.getId());
        TestUtils.banner("TEST: getPageAtVersionUsingExtendedId()");
        System.out.format("%s\n", pageHistorySummary);
        System.out.format("%s\n", page);

        assertEquals(pageHistorySummary.getVersion(), page.getVersion());
        assertEquals(pageHistorySummary.getModifier(), page.getModifier());
    }
View Full Code Here

        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getModifiedPagesHistory(30, 0, true);

        TestUtils.banner("TEST: getModifiedPageHistoryMultipleRequests()");
        for (int i = 0; i < pageHistorySummaries.size(); i++) {
            XWikiPageHistorySummary h1 = pageHistorySummaries.get(i);
            XWikiPageHistorySummary h2 = result.get(i);

            assertTrue(h1.getId().equals(h2.getId()));
            assertTrue(h1.getModifier().equals(h2.getModifier()));
            assertTrue(h1.getModified().equals(h2.getModified()));
            assertTrue(h1.getVersion() == h2.getVersion());
            assertTrue(h1.getMinorVersion() == h2.getMinorVersion());
        }

        long t = Long.MAX_VALUE;
        for (XWikiPageHistorySummary pageHistorySummary : result) {
            assertTrue(pageHistorySummary.getModified().getTime() <= t);
View Full Code Here

    }

    public void testGetPageAtVersion() throws Exception
    {
        List<XWikiPageHistorySummary> pageHistorySummaries = this.rpc.getPageHistory(TestConstants.TEST_PAGE);
        XWikiPageHistorySummary pageHistorySummary =
            pageHistorySummaries.get(this.random.nextInt(pageHistorySummaries.size()));

        XWikiPage page = this.rpc.getPage(TestConstants.TEST_PAGE, pageHistorySummary.getVersion());
        TestUtils.banner("TEST: getPageAtVersion()");
        System.out.format("%s\n", pageHistorySummary);
        System.out.format("%s\n", page);

        assertEquals(pageHistorySummary.getVersion(), page.getVersion());
        assertEquals(pageHistorySummary.getModifier(), page.getModifier());

        /*
         * This test occasionally fails because the version returned as the modification date by XWiki when getting a
         * page with a given version is always equal to the current date/time. So if the previous version to
         * getPageHistory is made, let's say at 12:53:59 and the subsequent getPage at 12:54:01 then the date in the
View Full Code Here

TOP

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

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.