예제 #1
0
  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());
  }
예제 #2
0
  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());
  }
예제 #3
0
  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;
  }