public void testDefaultRootPage() throws Exception { WikiPageFactory wikiPageFactory = new WikiPageFactory(); factory.loadWikiPage(wikiPageFactory); assertEquals(FileSystemPage.class, wikiPageFactory.getWikiPageClass()); WikiPage page = wikiPageFactory.makeRootPage("testPath", "TestRoot", factory); assertNotNull(page); assertEquals(FileSystemPage.class, page.getClass()); assertEquals("TestRoot", page.getName()); }
public void testRootPageCreation() throws Exception { testProperties.setProperty(ComponentFactory.WIKI_PAGE_CLASS, InMemoryPage.class.getName()); WikiPageFactory wikiPageFactory = new WikiPageFactory(); factory.loadWikiPage(wikiPageFactory); assertEquals(InMemoryPage.class, wikiPageFactory.getWikiPageClass()); WikiPage page = wikiPageFactory.makeRootPage(null, "", factory); assertNotNull(page); assertEquals(InMemoryPage.class, page.getClass()); }
public void testAddPlugins() throws Exception { testProperties.setProperty(ComponentFactory.PLUGINS, DummyPlugin.class.getName()); WikiPageFactory wikiPageFactory = new WikiPageFactory(); ResponderFactory responderFactory = new ResponderFactory("."); assertMatch("!today", false); String output = factory.loadPlugins(responderFactory, wikiPageFactory); assertSubString(DummyPlugin.class.getName(), output); assertEquals(InMemoryPage.class, wikiPageFactory.getWikiPageClass()); assertEquals(WikiPageResponder.class, responderFactory.getResponderClass("custom1")); assertEquals(EditResponder.class, responderFactory.getResponderClass("custom2")); assertMatch("!today", true); }