All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesse.wiki.WikiPageDummy Maven / Gradle / Ivy

There is a newer version: 20181217
Show newest version
// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.

package fitnesse.wiki;

import fitnesse.util.Clock;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class WikiPageDummy extends BaseWikiPage {

  private PageData pageData;

  public WikiPageDummy(String name, String content, WikiPage parent) {
    super(name, parent);
    pageData = new PageData(content, new WikiPageProperty());
  }

  public WikiPageDummy() {
    super("Default", null);
    pageData = new PageData("", new WikiPageProperty());
  }

  @Override
  public PageData getData() {
    return pageData;
  }

  @Override
  public Collection getVersions() {
    return Collections.emptySet();
  }

  @Override
  public VersionInfo commit(PageData data) {
    pageData = data;
    return new VersionInfo("mockVersionName", "mockAuthor", Clock.currentDate());
  }

  @Override
  public List getChildren() {
    return new ArrayList<>();
  }

  @Override
  public WikiPage getVersion(String versionName) {
    return this;
  }

  @Override
  public String getHtml() {
    return String.format("%s", pageData.getContent());
  }

  @Override
  public void removeChildPage(String name) {
  }

  @Override
  public PageCrawler getPageCrawler() {
    return new PageCrawler(this);
  }

  @Override
  public String getVariable(String name) {
    return null;
  }

  @Override
  public WikiPage addChildPage(String name) {
    return null;
  }

  @Override
  public WikiPage getChildPage(String name) {
    return null;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy