Пример #1
0
  public void testContentFilterCreation() throws Exception {
    assertEquals("", factory.loadContentFilter());
    assertEquals(null, SaveResponder.contentFilter);

    testProperties.setProperty(ComponentFactory.CONTENT_FILTER, TestContentFilter.class.getName());

    String content = factory.loadContentFilter();
    assertEquals(
        "\tContent filter installed: " + SaveResponder.contentFilter.getClass().getName() + "\n",
        content);
    assertNotNull(SaveResponder.contentFilter);
    assertEquals(TestContentFilter.class, SaveResponder.contentFilter.getClass());
  }
Пример #2
0
  private static FitNesseContext loadContext(Arguments arguments) throws Exception {
    FitNesseContext context = new FitNesseContext();
    ComponentFactory componentFactory = new ComponentFactory(context.rootPath);
    context.port = arguments.getPort();
    context.rootPath = arguments.getRootPath();
    context.rootPageName = arguments.getRootDirectory();
    context.rootPagePath = context.rootPath + "/" + context.rootPageName;
    context.root =
        componentFactory.getRootPage(
            FileSystemPage.makeRoot(context.rootPath, context.rootPageName));
    context.responderFactory = new ResponderFactory(context.rootPagePath);
    context.logger = makeLogger(arguments);
    context.authenticator = makeAuthenticator(arguments.getUserpass(), componentFactory);
    context.htmlPageFactory = componentFactory.getHtmlPageFactory(new HtmlPageFactory());

    extraOutput = componentFactory.loadResponderPlugins(context.responderFactory);
    extraOutput += componentFactory.loadWikiWidgetPlugins();
    extraOutput += componentFactory.loadWikiWidgetInterceptors();
    extraOutput += componentFactory.loadContentFilter();

    WikiImportTestEventListener.register();

    return context;
  }