public void testRenderPageContent() throws XmlRpcException
{
String pageContent = "**Text in Bold**{{velocity}}VelocityCode{{/velocity}}";
XWikiPage page = new XWikiPage();
page.setId(TestConstants.TEST_PAGE);
page.setContent(pageContent);
page.setSyntaxId("xwiki/2.0");
TestUtils.banner("TEST: renderPageContent");
System.out.format("\nCalling renderPageContent with context as page %s\n", TestConstants.TEST_PAGE);
System.out.format("\nWiki content is:\n%s\n", pageContent);
rpc.storePage(page);
try {
String renderedContent =
rpc.renderPageContent(page.getId(), page.getContent(), page.getSyntaxId(), "annotatedxhtml/1.0");
System.out.format("\nObtained rendered content:\n%s\n\n", renderedContent);
Assert.assertTrue(renderedContent.contains("Text in Bold"));
Assert.assertTrue(renderedContent.contains("startmacro"));
} finally {
rpc.removePage(page.getId());
}
}