
fitnesse.wiki.PageVariableSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
package fitnesse.wiki;
import fitnesse.wikitext.parser.Maybe;
import fitnesse.wikitext.parser.VariableSource;
public class PageVariableSource implements VariableSource {
private final WikiPage page;
public PageVariableSource(WikiPage page) {
this.page = page;
}
@Override
public Maybe findVariable(String key) {
String value;
if (key.equals("RUNNING_PAGE_NAME"))
value = page.getName();
else if (key.equals("RUNNING_PAGE_PATH"))
value = page.getPageCrawler().getFullPath().parentPath().toString();
else
return Maybe.noString;
return new Maybe<>(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy