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()); }
private static FitNesseContext initContext(String rootPath, int port) throws Exception { Builder builder = new Builder(); WikiPageFactory wikiPageFactory = new WikiPageFactory(); ComponentFactory componentFactory = new ComponentFactory(rootPath); builder.port = port; builder.rootPath = rootPath; builder.rootDirectoryName = "FitNesseRoot"; builder.pageTheme = componentFactory.getProperty(ComponentFactory.THEME); builder.defaultNewPageContent = componentFactory.getProperty(ComponentFactory.DEFAULT_NEWPAGE_CONTENT); builder.root = wikiPageFactory.makeRootPage(builder.rootPath, builder.rootDirectoryName, componentFactory); builder.logger = null; builder.authenticator = new PromiscuousAuthenticator(); FitNesseContext context = builder.createFitNesseContext(); return context; }